Skip to content

Commit 71cc52d

Browse files
committed
Return enqueued active job from RecurringTask#enqueue
So we can redirect to it after enqueuing manually from Mission Control.
1 parent 51c75be commit 71cc52d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/models/solid_queue/recurring_task.rb

+5-1
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,15 @@ def enqueue(at:)
6767
end
6868
end
6969

70-
payload[:active_job_id] = active_job.job_id if active_job
70+
active_job.tap do |enqueued_job|
71+
payload[:active_job_id] = enqueued_job.job_id
72+
end
7173
rescue RecurringExecution::AlreadyRecorded
7274
payload[:skipped] = true
75+
false
7376
rescue Job::EnqueueError => error
7477
payload[:enqueue_error] = error.message
78+
false
7579
end
7680
end
7781

0 commit comments

Comments
 (0)