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:
David Taylor 2022-02-04 20:11:03 +00:00 committed by GitHub
parent 863262a5de
commit f53d70ac63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -297,8 +297,7 @@ module Jobs
if ::Jobs.run_later?
hash = {
'class' => klass,
'args' => [opts.deep_stringify_keys]
'class' => klass
}
if delay = opts.delete(:delay_for)
@ -311,6 +310,8 @@ module Jobs
hash['queue'] = queue
end
hash['args'] = [opts.deep_stringify_keys]
DB.after_commit { klass.client_push(hash) }
else
# Otherwise execute the job right away