lib/good_job.rb in good_job-3.4.8 vs lib/good_job.rb in good_job-3.5.0
- old
+ new
@@ -155,10 +155,10 @@
timestamp = Time.current - older_than
include_discarded = GoodJob.configuration.cleanup_discarded_jobs?
ActiveSupport::Notifications.instrument("cleanup_preserved_jobs.good_job", { older_than: older_than, timestamp: timestamp }) do |payload|
old_jobs = GoodJob::Job.where('finished_at <= ?', timestamp)
- old_jobs = old_jobs.not_discarded unless include_discarded
+ old_jobs = old_jobs.succeeded unless include_discarded
old_jobs_count = old_jobs.count
GoodJob::Execution.where(job: old_jobs).delete_all
payload[:destroyed_records_count] = old_jobs_count
end