Pass correct args to chained :perform callbacks

Closes: CNVS-39627, AMS-701

The Delayed::Worker around callbacks are chained,
so all of the required parameters must be passed
through to the block in case it is another callback
that relies on them.

Change-Id: I740d42bfc36e3dda52c85802ddca673f2b2f6bb8
Reviewed-on: https://gerrit.instructure.com/128232
Tested-by: Jenkins
Reviewed-by: Dave Donahue <ddonahue@instructure.com>
Reviewed-by: Tyler Pickett <tpickett@instructure.com>
Product-Review: Jeremy Slade <jslade@instructure.com>
QA-Review: Jeremy Slade <jslade@instructure.com>
This commit is contained in:
Jeremy Slade 2017-10-03 10:38:36 -06:00
parent bc1536dce5
commit fbd50a83c6
1 changed files with 3 additions and 3 deletions

View File

@ -128,16 +128,16 @@ Delayed::Worker.lifecycle.around(:work_queue_pop) do |worker, config, &block|
end
end
Delayed::Worker.lifecycle.before(:perform) do |_job|
Delayed::Worker.lifecycle.before(:perform) do |_worker, _job|
# Since AdheresToPolicy::Cache uses an instance variable class cache lets clear
# it so we start with a clean slate.
AdheresToPolicy::Cache.clear
LoadAccount.clear_shard_cache
end
Delayed::Worker.lifecycle.around(:perform) do |job, &block|
Delayed::Worker.lifecycle.around(:perform) do |worker, job, &block|
CanvasStatsd::Statsd.batch do
block.call(job)
block.call(worker, job)
end
end