Skip to content

A platform for community discussion. Free, open, simple.

DEV: Ensure `delay_for` and `queue` are not passed as job arguments (#15824)

David Taylorf53d70ac63ed
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