我在rails 4 app中使用了resque和resque_scheduler.我的应用程序正在为resque做一些工作,但它们并没有被工人处理. reque-web显示没有失败.
我已经开始运行resque worker了
QUEUE = kqueue rake环境resque:工作
我的rails控制台
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...
解决方法
我遇到了同样的问题,然后:
>使用终端,转到您的项目目录>输入终端:QUEUE = * rake resque:work