代码之家  ›  专栏  ›  技术社区  ›  Matt Darby

延迟的作业多次运行同一个作业?

  •  2
  • Matt Darby  · 技术社区  · 14 年前

    我已经用了一段时间没有问题的工作;主要用于排队ActionMailer调用(Notifier.send\u later…)。最近,它从同一份工作中随机发送多封电子邮件。我会把一封邮件排成队列,然后我会同时收到五次,或者一次,或者两次。我重新开始了我的工作,它似乎有一点表现。有人经历过吗?

    这是我的日志;我以前从没见过这些错误。。。

    # 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>
    
    2 回复  |  直到 14 年前
        1
  •  2
  •   Jonathan Julian    14 年前

    当您部署应用程序的新版本时,请确保杀死所有DJ worker并只启动1个(或者不管您想要多少个-从1开始调试这个问题)。

    ps -ef | grep delayed_job
    
        2
  •  1
  •   Mateus Luiz    7 年前

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