Skip to content

Commit

Permalink
Block enqueueing if the batch is finished
Browse files Browse the repository at this point in the history
  • Loading branch information
jpcamara committed Sep 24, 2024
1 parent 59e521a commit b8233fd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/models/solid_queue/job_batch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ def as_active_job(active_job_klass)

# Instance-level enqueue
def enqueue(attributes = {})
raise "You cannot enqueue a batch that is already finished" if finished?

previous_batch_id = self.class.current_batch_id.presence || nil

transaction do
Expand Down

0 comments on commit b8233fd

Please sign in to comment.