mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Fix case where email method short-circuits and returns nil
This commit is contained in:
parent
e793ea9a6d
commit
4d3c05db49
2 changed files with 5 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
HEAD
|
||||
-----------
|
||||
|
||||
- ActionMailer.delay.method now only tries to deliver if method returns a valid message.
|
||||
- Logging now uses "MSG-#{Job ID}", not a random msg ID
|
||||
- Allow generic Redis provider as environment variable. [#443]
|
||||
- Add ability to customize sidekiq\_options with delay calls [#450]
|
||||
|
|
|
@ -16,7 +16,10 @@ module Sidekiq
|
|||
|
||||
def perform(yml)
|
||||
(target, method_name, args) = YAML.load(yml)
|
||||
target.send(method_name, *args).deliver
|
||||
msg = target.send(method_name, *args)
|
||||
# The email method can return nil, which causes ActionMailer to return
|
||||
# an undeliverable empty message.
|
||||
msg.deliver if msg && msg.to && msg.from
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue