File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,14 @@ def enqueue(at:)
8686 end
8787 rescue RecurringExecution ::AlreadyRecorded
8888 payload [ :skipped ] = true
89+ # The execution for this task and run time was already recorded by another
90+ # thread or process. Lookup the existing execution so we can still expose
91+ # the Active Job identifier in the instrumentation payload. This allows
92+ # consumers (and our test-suite) to reliably correlate the event with the
93+ # previously enqueued job even when it is reported as skipped.
94+ if ( existing_execution = SolidQueue ::RecurringExecution . find_by ( task_key : key , run_at : at ) )
95+ payload [ :active_job_id ] = existing_execution . job &.active_job_id
96+ end
8997 false
9098 rescue Job ::EnqueueError => error
9199 payload [ :enqueue_error ] = error . message
You can’t perform that action at this time.
0 commit comments