Project

General

Profile

Defect #11376 ยป async_parameter.patch

Etienne Massip, 2012-07-16 21:03

View differences:

app/models/mailer.rb (working copy)
def self.deliver_mail(mail)
return false if mail.to.blank? && mail.cc.blank? && mail.bcc.blank?
if self.async
Thread.start do
super
end
return true
end
super
end
config/initializers/10-patches.rb (working copy)
require 'mail'
module ActionMailer
class Base
cattr_accessor :async
end
end
module DeliveryMethods
class AsyncSMTP < ::Mail::SMTP
def deliver!(*args)
ActiveSupport::Deprecation.warn "async_smtp delivery method is deprecated and will be removed in Redmine 2.2. Use the async property at email_delivery level instead."
Thread.start do
super *args
end
......
class AsyncSendmail < ::Mail::Sendmail
def deliver!(*args)
ActiveSupport::Deprecation.warn "async_sendmail delivery method is deprecated and will be removed in Redmine 2.2. Use the async property at email_delivery level instead."
Thread.start do
super *args
end
    (1-1/1)