Skip to content

Commit 15b76f5

Browse files
[9.x] Enable batch jobs delay for Beanstalkd queue. (#41789)
* [9.x] Enable batch jobs delay for Beanstalkd queue. [before] - batch jobs was ignoring delay time when pushing into beanstalkd. [after] - batch jobs delay time will be considered and put into beanstalkd. * Update BeanstalkdQueue.php * Update BeanstalkdQueue.php Co-authored-by: Taylor Otwell <[email protected]>
1 parent 0cc725b commit 15b76f5

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Illuminate/Queue/BeanstalkdQueue.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,25 @@ function ($payload, $queue, $delay) {
136136
);
137137
}
138138

139+
/**
140+
* Push an array of jobs onto the queue.
141+
*
142+
* @param array $jobs
143+
* @param mixed $data
144+
* @param string|null $queue
145+
* @return void
146+
*/
147+
public function bulk($jobs, $data = '', $queue = null)
148+
{
149+
foreach ((array) $jobs as $job) {
150+
if (isset($job->delay)) {
151+
$this->later($job->delay, $job, $data, $queue);
152+
} else {
153+
$this->push($job, $data, $queue);
154+
}
155+
}
156+
}
157+
139158
/**
140159
* Pop the next job off of the queue.
141160
*

0 commit comments

Comments
 (0)