简体   繁体   English

Delayed_Jobs将不会刷新

[英]Delayed_Jobs will not refresh

I had previously a mailer set up to send me emails to all user accounts. 我以前曾设置过一个邮件发送器,用于向我发送所有用户帐户的电子邮件。 But now I'm trying to debug it. 但是现在我正在尝试调试它。 So I gutted it out completely and it still sends emails to me. 因此,我将其完全清除掉,它仍然向我发送电子邮件。

I have absolutely no reasoning or understanding as to why. 对于原因,我绝对没有任何推理或理解。 Insanity! 疯狂! :D :d

controller 调节器

def org_blast_send
  Delayed::Job.enqueue OrgBlast.new(params[:subject], params[:editor1])
  redirect_to org_blast_admin_email_blast_path
end

org_blast.rb org_blast.rb

class OrgBlast < Struct.new(:subject, :editor1)
  def perform
    # You see? There is absolute nothing here but it still sends an email.
    # However, if I rename this file, the website fails looking for it.
  end
end

notifier.rb notifier.rb

def org_blast(org, subject, message)
  subject subject
  from NOTIFIER_EMAIL
  recipients org.users.first.email
  sent_on Time.zone.now
  body :user => org.users.first.first_name + ' ' + org.users.first.last_name, :message => message
  content_type  "text/html"
end

If you are running delayed_jobs on your local, it must be stopped and restarted or it will despite your code do whatever was in your code the last time it was started. 如果您在本地计算机上运行delay_jobs,则必须停止并重新启动它,否则尽管您的代码执行了上次启动时所做的任何操作, 它仍会执行。

>> script/delayed_job stop
>> script/delayed_job start

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM