Skip to content

Commit

Permalink
fix(cli) handles unlimited ulimit. Closes #1384.
Browse files Browse the repository at this point in the history
  • Loading branch information
subnetmarco committed Aug 30, 2016
1 parent e1a8da0 commit f9d3fb4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kong/cmd/utils/prefix_handler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,12 @@ end
local function get_ulimit()
local ok, _, stdout, stderr = pl_utils.executeex "ulimit -n"
if not ok then return nil, stderr end
return tonumber(pl_stringx.strip(stdout))
local sanitized_limit = pl_stringx.strip(stdout)
if sanitized_limit:lower():match("unlimited") then
return 65536
else
return tonumber(sanitized_limit)
end
end

local function gather_system_infos(compile_env)
Expand Down

0 comments on commit f9d3fb4

Please sign in to comment.