简体   繁体   English

“上帝”没有开始resque工人

[英]“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. 我基本上从Github复制了配置文件,但它似乎没有正确启动resque worker。 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. 但是没有工人出现在resque-web界面中,也没有任何工作被从队列中拉出来。 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. 此外,我已经尝试使用我常用的脚本从命令行启动一个worker,并且按预期工作。 Oh, and this running on Ubuntu 10.04 哦,这在Ubuntu 10.04上运行

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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