From f53d70ac63ed8bef243fa03ce4794f95c3c1ce0a Mon Sep 17 00:00:00 2001 From: David Taylor Date: Fri, 4 Feb 2022 20:11:03 +0000 Subject: [PATCH] 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 --- app/jobs/base.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/jobs/base.rb b/app/jobs/base.rb index 180adbe0864..379ed72b985 100644 --- a/app/jobs/base.rb +++ b/app/jobs/base.rb @@ -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