我正在努力将Sidekiq与God Gem一起使用。我希望能够使用 手动启动sidekiq 进程$god start sidekiq
,但是无法启动该进程。如果我设置 w.keepalive(在下面的代码中注释掉),我只能让它启动 sidekiq 进程。
我正在使用:$ god -c "./config.god" -D --log-level info
启动上帝,在前台启动上帝,这让我得到以下输出:
I [2013-01-22 17:46:00] INFO: Started on drbunix:///tmp/god.17165.sock
I [2013-01-22 17:46:00] INFO: sidekiq move 'unmonitored' to 'up'
I [2013-01-22 17:46:00] INFO: sidekiq moved 'unmonitored' to 'up'
使用$god start sidekiq
我得到:
Sending 'start' command
The following watches were affected:
sidekiq
但是我没有从上帝那里得到任何输出,sidekiq 的日志中没有写入任何内容,而且我可以清楚地看到使用$ ps auxwww | grep sidekiq
.
# config.god
PROJECT_ROOT = ENV['PROJECT_ROOT'] || File.dirname(__FILE__) # Dir containing this file
# Sidekiq Process
God.watch do |w|
w.name = "sidekiq"
w.group = "conversion"
w.dir = PROJECT_ROOT
w.interval = 20.seconds
w.start_grace = 10.seconds
w.restart_grace = 10.seconds
w.behavior(:clean_pid_file)
# w.keepalive
w.start = "bundle exec sidekiq -v -C #{File.join(PROJECT_ROOT, 'config.yml')}"
w.stop = "bundle exec sidekiqctl stop '/Users/me/.god/pids/sidekiq.pid' 5"
w.log = File.join(PROJECT_ROOT, 'log/god_sidekiq.log')
end