Rails4:为什么resque工人没有找到工作

时间:2014-01-04 11:26:51

标签: ruby-on-rails ruby ruby-on-rails-4 resque resque-scheduler

我在rails 4 app中使用了resque和resque_scheduler。我的应用程序正在为resque做一些工作,但它们并没有被工人处理。 reque-web显示没有失败。

我已经通过运行

启动了resque worker

QUEUE=kqueue rake environment resque:work

my rails console

2.0.0p353 :006 > Resque.info

 => {:pending=>0, :processed=>0, :queues=>0, :workers=>1, :working=>0, :failed=>0, :servers=>["redis://localhost:6379/0"], :environment=>"development"} 

2.0.0p353 :007 > Resque.redis

 => #<Redis::Namespace:0x007fbb0fbf3e58 @namespace=:resque, @redis=#<Redis client v3.0.6 for redis://localhost:6379/0>, @warning=false> 

2.0.0p353 :008 > Resque.workers

 => [#<Worker xxx-macbook.local:16869:kqueue>] 

关于redis,

redis 127.0.0.1:6379> keys *
1) "resque:workers"
2) "resque:delayed_queue_schedule"
3) "resque:worker:xxx-macbook.local:16869:kqueue:started"
4) "resque:timestamps:{\"class\":\"InvokeScheduler\",\"args\":[{\"target\":\"/sendmail\",\"http_method\":\"post\",\"type\":\"signup_verification\",\"user_id\":31}],\"queue\":\"kqueue\"}"
5) "resque:delayed:1388832771"
resque-web说:

0 of 1 Workers Working

Failed Jobs
Showing 0 to 0 of 0 jobs


Worker xxx-macbook.local:16869:kqueue

Host    Pid   Started Queues  Processed Failed  Processing
xxx-macbook.local 16869 15 minutes ago  KQUEUE  0 0 Waiting for a job...

1 个答案:

答案 0 :(得分:-4)

我遇到了同样的问题,然后:

  • 使用终端,转到您的项目目录
  • 输入终端:QUEUE=* rake resque:work