DEV: adjust bin/unicorn to support -p properly

This commit is contained in:
Sam 2018-08-15 10:35:24 +10:00
parent c8d369a659
commit b8667c77c4

View File

@ -19,6 +19,11 @@ if !ARGV.include?("-E") &&
Pathname.new(__FILE__).realpath)) Pathname.new(__FILE__).realpath))
end end
# we do not want to listen on 2 ports, so lets fix it
if (idx = ARGV.index("-p")) && (port = ARGV[idx + 1].to_i) > 0
ENV["UNICORN_PORT"] ||= port.to_s
end
ENV["UNICORN_PORT"] ||= "9292" ENV["UNICORN_PORT"] ||= "9292"
ENV["UNICORN_SIDEKIQS"] ||= "1" ENV["UNICORN_SIDEKIQS"] ||= "1"