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