【发布时间】:2014-01-22 02:37:34
【问题描述】:
我在我的 rails 4 应用程序中使用 resque 和 resque_scheduler。我的应用程序正在为 resque 提供一些工作,但它们并没有被工人处理。 reque-web 没有显示失败。
我已经通过运行启动 resque worker
QUEUE=kqueue rake environment resque:work
我的 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...
【问题讨论】:
-
似乎没有该工人可以从事的工作。你确定你的工作排队正确吗?你如何排队?您是否在 application.rb 中将 rails 队列设置为 resque?
-
@DominikGoltermann 你可以看到redis显示作业在我上面的详细信息中排队。那你怎么看不排队呢?
-
@DominikGoltermann “您是否在 application.rb 中将 rails 队列设置为 resque?”是什么意思?
-
您能否向我们提供您的环境(Heroku 等)的详细信息?
-
@JVK 它显示了 0 个待处理的作业,尽管 redis 键可能表明存在一个设置为在特定时间运行的排队作业(2014 年 1 月 4 日星期六 10:52:51 GMT) (不确定 resque 如何插入键)。关于 application.rb 我是 Rails.queue 的事情。不知道你是否正在使用它。
标签: ruby-on-rails ruby ruby-on-rails-4 resque resque-scheduler