Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return enqueued active job from RecurringTask#enqueue #404

Merged
merged 1 commit into from
Nov 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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