Delayed_job多次运行相同的作业?

问题描述:

我一直在使用delayed_job而没有问题一段时间;主要用于排队ActionMailer调用(Notifier.send_later ...)。最近它发送了来自同一份工作的随机多个电子邮件。我会排队一封电子邮件,我会同时收到五次,或一次,或两次。我已经重新启动了delayed_job,它似乎有点行为。任何人都会遇到这个问题Delayed_job多次运行相同的作业?

这是我的日志;我从来没见过这些错误......

# Logfile created on 2010-02-11 by logger.rb 
*** below you find the most recent exception thrown, this will be likely (but not certainly) the exception that made the application exit abnormally *** 
#<NameError: uninitialized constant Delayed::Worker> 
*** below you find all exception objects found in memory, some of them may have been thrown in your application, others may just be in memory because they are standard exceptions *** 
#<NoMemoryError: failed to allocate memory> 
#<SystemStackError: stack level too deep> 
#<fatal: exception reentered> 
#<LoadError: no such file to load -- tmail> 
#<SystemExit: exit> 
#<NameError: uninitialized constant Delayed::Worker::Merb> 
#<NameError: uninitialized constant Merb> 
#<NameError: uninitialized constant Delayed::Merb> 
#<NameError: uninitialized constant Merb> 
#<NameError: uninitialized constant Delayed::Merb> 
#<NameError: uninitialized constant Delayed::Worker::Merb> 
#<NameError: "Gems::DelayedJob-1.8.4::Lib::Delayed::Worker" is not a valid constant name!> 
#<NameError: uninitialized constant Delayed::Worker> 

当您部署应用程序的新版本,请确保杀死所有DJ工人和仅启动1(或包含很多你想要的 - 从1开始调试这个问题)。

ps -ef | grep delayed_job 
+1

是否有多个DJ工作进程具有相同工人名称的问题?在什么情况下,一个以上的员工可以完成同样的任务? – 2012-01-26 11:12:53

我有同样的问题,当我检查了我的队列,我发现我在工作有错误和DJ试图再次运行,这再次工作。