I'm trying to get hirefire to work with Heroku Cedar Stack. I tried using this patch, but that doesn't seem to help either. Workers are not getting spun up at all. Anybody here has a solution that works?
问问题
476 次
1 回答
1
在查看了hirefire source后,我找到了解决方案。我的问题是作业队列中有一个锁定的作业。因此,delayed_job.working 结果是 1 而不是 0。此外,由于锁定的工作,delayed_job.jobs 也是 1。因此没有雇用任何工人。我从队列中清除了所有的工作,然后hirefire 就像一个魅力一样工作。
def hirefire_hire
delayed_job = ::Delayed::Job.new
if delayed_job.working == 0 \
or delayed_job.jobs == 1
environment.hire
end
end
我认为应该修改此检查以检查未锁定的作业数量或类似性质的东西。
于 2012-02-11T22:10:29.937 回答