Project

General

Profile

Defect #11376 ยป async_parameter.patch

Etienne Massip, 2012-07-16 21:03

View differences:

app/models/mailer.rb (working copy)
418 418
  
419 419
  def self.deliver_mail(mail)
420 420
    return false if mail.to.blank? && mail.cc.blank? && mail.bcc.blank?
421
    if self.async
422
      Thread.start do
423
        super
424
      end
425
      return true
426
    end
421 427
    super
422 428
  end
423 429

  
config/initializers/10-patches.rb (working copy)
47 47

  
48 48
require 'mail'
49 49

  
50
module ActionMailer
51
  class Base
52
    cattr_accessor :async
53
  end
54
end
55

  
50 56
module DeliveryMethods
51 57
  class AsyncSMTP < ::Mail::SMTP
52 58
    def deliver!(*args)
59
      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."
53 60
      Thread.start do
54 61
        super *args
55 62
      end
......
58 65

  
59 66
  class AsyncSendmail < ::Mail::Sendmail
60 67
    def deliver!(*args)
68
      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."
61 69
      Thread.start do
62 70
        super *args
63 71
      end
    (1-1/1)