From b18f6212d200ccd562ebf305f4a9505f8976719a Mon Sep 17 00:00:00 2001 From: Aaron Ogata Date: Fri, 1 Apr 2022 07:34:40 -0700 Subject: [PATCH] ensure job is queued using the correct shard_id refs DE-1120 Change-Id: Icbc9e8a30fc3b233b440ec47bd26c4a92ec797fa Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/288706 Tested-by: Service Cloud Jenkins Reviewed-by: Alex Slaughter QA-Review: Aaron Ogata Product-Review: Aaron Ogata --- config/initializers/periodic_jobs.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config/initializers/periodic_jobs.rb b/config/initializers/periodic_jobs.rb index b980fefda00..460d09cc20d 100644 --- a/config/initializers/periodic_jobs.rb +++ b/config/initializers/periodic_jobs.rb @@ -62,7 +62,10 @@ class PeriodicJobs priority: 40 } dj_params[:run_at] = compute_run_at(jitter: jitter, local_offset: local_offset) - klass.delay(**dj_params).__send__(method, *args) + + current_shard.activate do + klass.delay(**dj_params).__send__(method, *args) + end end end end