Rescue from an exception when sending emails in podmin:admin_email
This commit is contained in:
parent
a4eafe8a87
commit
d0b37fa7ee
1 changed files with 8 additions and 4 deletions
|
|
@ -16,11 +16,15 @@ namespace :podmin do
|
||||||
mails = Notifier.admin(msg.html_safe, users, :subject => args[:subject])
|
mails = Notifier.admin(msg.html_safe, users, :subject => args[:subject])
|
||||||
count = 0
|
count = 0
|
||||||
mails.each do |mail|
|
mails.each do |mail|
|
||||||
|
begin
|
||||||
mail.deliver
|
mail.deliver
|
||||||
count += 1
|
count += 1
|
||||||
if count % 100 == 0
|
if count % 100 == 0
|
||||||
puts "#{count} out of #{mails.count} delivered"
|
puts "#{count} out of #{mails.count} delivered"
|
||||||
end
|
end
|
||||||
|
rescue
|
||||||
|
puts $!, $@
|
||||||
|
end
|
||||||
end
|
end
|
||||||
puts "#{count} out of #{mails.count} delivered"
|
puts "#{count} out of #{mails.count} delivered"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue