2

我一直在使用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>
4

2 回答 2

2

当您部署应用程序的新版本时,请确保杀死所有 DJ 工作人员并仅启动 1 个(或者您想要的任意多个 - 从 1 开始以调试此问题)。

ps -ef | grep delayed_job
于 2010-02-12T18:13:22.217 回答
1

我遇到了同样的问题,当我检查我的队列时,我发现我的工作出错了,DJ 试图一次又一次地运行这个工作。

于 2017-12-19T14:29:58.297 回答