Rescue from an exception when sending emails in podmin:admin_email

This commit is contained in:
Jason Robinson 2014-08-17 18:14:36 +03:00
parent a4eafe8a87
commit d0b37fa7ee

View file

@ -16,10 +16,14 @@ namespace :podmin do
mails = Notifier.admin(msg.html_safe, users, :subject => args[:subject])
count = 0
mails.each do |mail|
mail.deliver
count += 1
if count % 100 == 0
puts "#{count} out of #{mails.count} delivered"
begin
mail.deliver
count += 1
if count % 100 == 0
puts "#{count} out of #{mails.count} delivered"
end
rescue
puts $!, $@
end
end
puts "#{count} out of #{mails.count} delivered"