1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Dumb down ActionMailer integration, fixes #2149

This commit is contained in:
Mike Perham 2015-01-23 11:19:59 -08:00
parent f074cce972
commit a7ddb44abb
2 changed files with 7 additions and 1 deletions

View file

@ -1,5 +1,7 @@
HEAD
-----------
- Dumb down ActionMailer integration so it tries to deliver if possible [#2149]
- Stringify Sidekiq.default_worker_options's keys [#2126]
- Add random integer to process identity [#2113, michaeldiscala]
- Log Sidekiq Pro's Batch ID if available [#2076]

View file

@ -17,7 +17,11 @@ module Sidekiq
msg = target.public_send(method_name, *args)
# The email method can return nil, which causes ActionMailer to return
# an undeliverable empty message.
deliver(msg) if msg && (msg.to || msg.cc || msg.bcc) && msg.from
if msg
deliver(msg)
else
logger.warn("#{target.name}##{method_name} returned an undeliverable mail object")
end
end
private