我在我的rails应用程序中使用resque和resque-scheduler。我在使用resque-scheduler时遇到了奇怪的问题。我的一个作业没有从队列中删除,一旦它完成了'perform‘方法。我需要显式地杀死它以退出队列,然后队列中的其他作业开始执行。
Job类很简单,如下所示:
class FooJob
@queue = :high_volume
def self.perform
puts "FooJob#perform:"
# some method call
end
endresque_schedule.yml包含:
add_jobs_from_foo:
cron: "15 * * * *"
class: FooJob
description: "enqueue jobs from Foo"在gem版本中会有问题吗?或者其他的?
发布于 2011-04-06 00:38:17
你实际上是通过直接查看redis来验证的吗?作业甚至在perform开始执行之前就从队列中删除了。
发布于 2012-10-04 14:17:13
让我们试试这个gem "resque-status“
获取作业状态-
status = Resque::Plugins::Status::Hash.get(job_id)Resque::Plugins::Status::Hash.get(job_id)对象将返回:
status.pct_complete #=> 0
status.status #=> 'queued'
status.queued? #=> true
status.working? #=> false
status.time #=> Time object
status.message #=> "Created at ..."获取这个gem并查看详细信息:https://github.com/quirkey/resque-status
https://stackoverflow.com/questions/5552743
复制相似问题