我一直在使用delayed_job一段时间没有问题;主要用于排队ActionMailer调用(Notifier.send_later ...)。最近,它发出来自同一作业的随机多个电子邮件。我将排队一封电子邮件,我将同时收到五次,或一次或两次。我重新启动了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>
答案 0 :(得分:2)
当您部署新版本的应用程序时,请确保终止所有DJ工作人员,并且只启动1(或者您想要的多少 - 从1开始调试此问题)。
ps -ef | grep delayed_job
答案 1 :(得分:1)
我遇到了同样的问题,当我查看我的队列时,我发现我在工作中遇到错误而且DJ正试图一次又一次地运行这个工作。