简体   繁体   中英

“god” not starting resque worker

I'm having some trouble getting the god gem up and running. I've essentially copied the config file from Github but it doesn't seem to be starting the resque worker properly. My config file looks like the following:

rails_env   = "production"
rails_root  = "/path/to/root"
num_workers = 1

num_workers.times do |num|
  God.watch do |w|
    w.dir      = "#{rails_root}"
    w.name     = "emailer-#{num}"
    w.group    = 'emailer'
    w.interval = 30.seconds
    w.behavior(:clean_pid_file)
    w.env      = {"QUEUE"=>"emailer", "RAILS_ENV"=>rails_env}
    w.start    = "/usr/local/bin/rake -f #{rails_root}/Rakefile environment resque:work"

  end
end

And I'm running god with the following command:

sudo god -c resque.god -D

This gives me the following output:

I [2012-08-15 19:32:00]  INFO: resque.god
I [2012-08-15 19:32:00]  INFO: Syslog enabled.
I [2012-08-15 19:32:00]  INFO: Using pid file directory: /var/run/god
I [2012-08-15 19:32:00]  INFO: Socket already in use
I [2012-08-15 19:32:01]  INFO: Socket is stale, reopening
I [2012-08-15 19:32:01]  INFO: Started on drbunix:///tmp/god.17165.sock
I [2012-08-15 19:32:01]  INFO: emailer-0 move 'unmonitored' to 'up'
I [2012-08-15 19:32:01]  INFO: emailer-0 moved 'unmonitored' to 'up'

But no worker ever shows up in resque-web interface and no jobs ever get pulled from the queue. Can anyone spot what I'm doing wrong? Also, I have already tried starting a worker from the command line with my usual script and that works as expected. Oh, and this running on Ubuntu 10.04

我想你需要在w.start上传递queue_name,如下所示:

w.start = "/usr/local/bin/rake -f #{rails_root}/Rakefile environment resque:work QUEUE=emailer"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM