Skip to content

Commit a810948

Browse files
Mat-Sedkowskicodez
andauthored
Adjust CronJob example to ignore failed jobs if they are not destroyed
Co-authored-by: z <[email protected]>
1 parent a2d3f2a commit a810948

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class CronJob < ApplicationJob
7575
def delayed_job
7676
Delayed::Job
7777
.where('handler LIKE ?', "%job_class: #{name}%")
78+
.where(failed_at: nil) # ignore failed jobs if destroy_failed_jobs == false
7879
.first
7980
end
8081

0 commit comments

Comments
 (0)