Skip to content

Commit 181f6f4

Browse files
committed
Block enqueueing if the batch is finished
1 parent 69a8899 commit 181f6f4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/models/solid_queue/job_batch.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ def as_active_job(active_job_klass)
7171

7272
# Instance-level enqueue
7373
def enqueue(attributes = {})
74+
raise "You cannot enqueue a batch that is already finished" if finished?
75+
7476
previous_batch_id = self.class.current_batch_id.presence || nil
7577

7678
transaction do

0 commit comments

Comments
 (0)