ruby - unicorn的配置如何按环境分开多个pid?
PHP中文网
PHP中文网 2017-04-21 11:15:27
0
0
595

比如unicorn的配置文件(config/unicorn.rb)中默认这样写:

listen "/tmp/myapp/unicorn.sock", backlog: 1
pid "/tmp/myapp/unicorn.pid"

要根据实际运行环境和测试环境区分开,想这样实现:

if ENV["RAILS_ENV"] == "production"
  listen "/tmp/myapp/unicorn.sock", backlog: 1
  pid "/tmp/myapp/unicorn.pid"
else
  listen "/tmp/myapp/test.sock", backlog: 1
  pid "/tmp/myapp/test.pid"
end

却不能达到目的,有没有可行方法?

PHP中文网
PHP中文网

认证0级讲师

reply all(0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!