DEV: Ensure Sidekiq job arguments have stringified keys
The latest version of Sidekiq introduced a warning when jobs are queued with arguments which 'do not stringify to JSON safely'. In the vast majority of cases, this is because a hash is passed with symbols as keys. When those args are passed to the job, the keys will be stringified. Our job wrapper already takes care of this issue by calling '.with_indifferent_access' on the args before passing them to `#execute`, so we don't need to change anything about our use. All we need to do is satisfy Sidekiq's warning system by 'stringifying' all the keys before enqueuing the job.
This commit is contained in:
parent
62029ec4eb
commit
3a85c4d680
|
@ -298,7 +298,7 @@ module Jobs
|
||||||
if ::Jobs.run_later?
|
if ::Jobs.run_later?
|
||||||
hash = {
|
hash = {
|
||||||
'class' => klass,
|
'class' => klass,
|
||||||
'args' => [opts]
|
'args' => [opts.deep_stringify_keys]
|
||||||
}
|
}
|
||||||
|
|
||||||
if delay = opts.delete(:delay_for)
|
if delay = opts.delete(:delay_for)
|
||||||
|
|
Loading…
Reference in New Issue