dvdplm-ar_mailer 2.0.6 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/action_mailer/ar_sendmail.rb +3 -3
- metadata +1 -1
|
@@ -46,7 +46,7 @@ class ActionMailer::ARSendmail
|
|
|
46
46
|
##
|
|
47
47
|
# The version of ActionMailer::ARSendmail you are running.
|
|
48
48
|
|
|
49
|
-
VERSION = '2.0.
|
|
49
|
+
VERSION = '2.0.7'
|
|
50
50
|
|
|
51
51
|
##
|
|
52
52
|
# Maximum number of times authentication will be consecutively retried
|
|
@@ -432,7 +432,7 @@ end
|
|
|
432
432
|
def cleanup
|
|
433
433
|
return if @max_age == 0
|
|
434
434
|
timeout = Time.now - @max_age
|
|
435
|
-
conditions = ['last_send_attempt > 0
|
|
435
|
+
conditions = ['last_send_attempt > 0 AND created_at < ? AND sent_at IS NULL', timeout]
|
|
436
436
|
mail = @email_class.update_all({:failed => true}, conditions)
|
|
437
437
|
|
|
438
438
|
log "#{self.class}#cleanup expired #{mail} emails from the queue"
|
|
@@ -519,7 +519,7 @@ end
|
|
|
519
519
|
# last 300 seconds.
|
|
520
520
|
|
|
521
521
|
def find_emails
|
|
522
|
-
options = { :conditions =>
|
|
522
|
+
options = { :conditions => ['sent_at IS NULL AND failed = 0 AND (? - last_send_attempt) > 300', Time.now.to_i]}
|
|
523
523
|
options[:limit] = batch_size unless batch_size.nil?
|
|
524
524
|
mail = @email_class.find :all, options
|
|
525
525
|
|