Skip to content

Commit

Permalink
Return enqueued active job from RecurringTask#enqueue
Browse files Browse the repository at this point in the history
So we can redirect to it after enqueuing manually from Mission Control.
  • Loading branch information
rosa committed Nov 7, 2024
1 parent 51c75be commit 71cc52d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/solid_queue/recurring_task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,15 @@ def enqueue(at:)
end
end

payload[:active_job_id] = active_job.job_id if active_job
active_job.tap do |enqueued_job|
payload[:active_job_id] = enqueued_job.job_id
end
rescue RecurringExecution::AlreadyRecorded
payload[:skipped] = true
false
rescue Job::EnqueueError => error
payload[:enqueue_error] = error.message
false
end
end

Expand Down

0 comments on commit 71cc52d

Please sign in to comment.