【问题标题】:"god" not starting resque worker“上帝”没有启动 resque worker
【发布时间】:2012-08-12 08:35:16
【问题描述】:

我在启动和运行上帝宝石时遇到了一些麻烦。我基本上已经从 Github 复制了配置文件,但它似乎并没有正确启动 resque worker。我的配置文件如下所示:

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

我正在使用以下命令运行上帝:

sudo god -c resque.god -D

这给了我以下输出:

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'

但是没有工作人员出现在 resque-web 界面中,也没有工作从队列中拉出。谁能发现我做错了什么?此外,我已经尝试使用我常用的脚本从命令行启动一个工作人员,并且按预期工作。哦,这在 Ubuntu 10.04 上运行

【问题讨论】:

    标签: ruby-on-rails ruby resque god


    【解决方案1】:

    我认为您需要像这样在 w.start 上传递 queue_name:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-08-18
      • 2011-11-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多