mirror of
https://github.com/discourse/discourse.git
synced 2025-02-08 04:18:23 +00:00
DEV: Ensure delay_for
and queue
are not passed as job arguments (#15824)
This regressed in 3a85c4d680 because deep_stringify_keys makes a copy of the `opts` hash
This commit is contained in:
parent
863262a5de
commit
f53d70ac63
@ -297,8 +297,7 @@ module Jobs
|
|||||||
|
|
||||||
if ::Jobs.run_later?
|
if ::Jobs.run_later?
|
||||||
hash = {
|
hash = {
|
||||||
'class' => klass,
|
'class' => klass
|
||||||
'args' => [opts.deep_stringify_keys]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if delay = opts.delete(:delay_for)
|
if delay = opts.delete(:delay_for)
|
||||||
@ -311,6 +310,8 @@ module Jobs
|
|||||||
hash['queue'] = queue
|
hash['queue'] = queue
|
||||||
end
|
end
|
||||||
|
|
||||||
|
hash['args'] = [opts.deep_stringify_keys]
|
||||||
|
|
||||||
DB.after_commit { klass.client_push(hash) }
|
DB.after_commit { klass.client_push(hash) }
|
||||||
else
|
else
|
||||||
# Otherwise execute the job right away
|
# Otherwise execute the job right away
|
||||||
|
Loading…
x
Reference in New Issue
Block a user