ruby - How to configure god/redis for two environments? -
i want use god monitor redis server. problem in different locations locally , on server. tried doing causes god fail.
%w{6379}.each |port| god.watch |w| w.name = "redis" w.interval = 30.seconds if rails_env == 'development' w.start = "/usr/local/bin/redis-server /usr/local/bin" w.stop = "/usr/local/bin/redis-cli -p 6379 shutdown" else # in production w.start = "/usr/local/etc/redis-server /usr/local/etc" w.stop = "/usr/local/etc/redis-cli -p 6379 shutdown" end end end
use
if env["rails_env"] == 'development'
and call script using
rails_env=development sudo god ...
in dev environment.
and in production:
sudo god ...
Comments
Post a Comment