Skip to content

Commit

Permalink
Generalizes batch_enqueue method
Browse files Browse the repository at this point in the history
Refines parameter type for batch_enqueue to accommodate
various job types, enhancing flexibility in job management.
  • Loading branch information
eliasjpr committed Nov 26, 2024
1 parent 0db74e4 commit 4a4831a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/joobq/job.cr
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ module JoobQ
# ```
# TestJob.batch_enqueue([job1, job2, job3])
# ```
def self.batch_enqueue(jobs : Array(Job), batch_size : Int32 = 1000) : Nil
def self.batch_enqueue(jobs : Array({{@type}}), batch_size : Int32 = 1000) : Nil
raise "Batch size must be greater than 0" if batch_size <= 0
raise "Batch size must be less than or equal to 1000" if batch_size > 1000
JoobQ.store.enqueue_batch(jobs)
Expand Down

0 comments on commit 4a4831a

Please sign in to comment.