Skip to content

Commit 6effa16

Browse files
committed
We no longer need to keep jobs
* Batch execution is managed through the BatchExecution model, which is dependent destroyed when jobs are destroyed * Since it checks batch completion in an after_commit on: :destroy, it already gets checked, even when the job is not preserved * Because we rely on batch executions and counts, we don't need the jobs to stick around to properly run a batch
1 parent 7b8462a commit 6effa16

File tree

3 files changed

+1
-22
lines changed

3 files changed

+1
-22
lines changed

app/jobs/solid_queue/batch/cleanup_job.rb

Lines changed: 0 additions & 15 deletions
This file was deleted.

app/models/solid_queue/batch.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,6 @@ def execute_callbacks
111111
end
112112

113113
perform_completion_job(:on_finish, {}) if on_finish.present?
114-
115-
clear_unpreserved_jobs
116-
end
117-
118-
def clear_unpreserved_jobs
119-
SolidQueue::Batch::CleanupJob.set(queue: self.class.maintenance_queue_name || "default").perform_later(self) unless SolidQueue.preserve_finished_jobs?
120114
end
121115

122116
def enqueue_empty_job

app/models/solid_queue/job/executable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def dispatch_bypassing_concurrency_limits
7878
end
7979

8080
def finished!
81-
if SolidQueue.preserve_finished_jobs? || batch_id.present? # We clear jobs after the batch finishes
81+
if SolidQueue.preserve_finished_jobs?
8282
update!(finished_at: Time.current)
8383
else
8484
destroy!

0 commit comments

Comments
 (0)