简体   繁体   中英

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

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

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

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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