lib/good_job.rb in good_job-3.15.4 vs lib/good_job.rb in good_job-3.15.5

- old
+ new

@@ -176,11 +176,13 @@ jobs_query = jobs_query.succeeded unless include_discarded loop do active_job_ids = jobs_query.pluck(:active_job_id) break if active_job_ids.empty? - deleted_discrete_executions = GoodJob::DiscreteExecution.where(active_job_id: active_job_ids).delete_all - deleted_discrete_executions_count += deleted_discrete_executions + if GoodJob::Execution.discrete_support? + deleted_discrete_executions = GoodJob::DiscreteExecution.where(active_job_id: active_job_ids).delete_all + deleted_discrete_executions_count += deleted_discrete_executions + end deleted_executions = GoodJob::Execution.where(active_job_id: active_job_ids).delete_all deleted_executions_count += deleted_executions end