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