3
votes

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

1

1 Answers

0
votes

I think you need to pass the queue_name on w.start like this:

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