Skip to content

Commit 8326ba8

Browse files
[9.x] Enable batch jobs delay for SQS queue (#41788)
* [9.x] Enable batch jobs delay for SQS queue [before] - batch jobs was ignoring delay time when sending message to sqs. [after] - batch jobs delay time will be considered and sent to sqs. * Update SqsQueue.php Co-authored-by: Taylor Otwell <[email protected]>
1 parent 15b76f5 commit 8326ba8

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/Illuminate/Queue/SqsQueue.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,25 @@ function ($payload, $queue, $delay) {
141141
);
142142
}
143143

144+
/**
145+
* Push an array of jobs onto the queue.
146+
*
147+
* @param array $jobs
148+
* @param mixed $data
149+
* @param string|null $queue
150+
* @return void
151+
*/
152+
public function bulk($jobs, $data = '', $queue = null)
153+
{
154+
foreach ((array) $jobs as $job) {
155+
if (isset($job->delay)) {
156+
$this->later($job->delay, $job, $data, $queue);
157+
} else {
158+
$this->push($job, $data, $queue);
159+
}
160+
}
161+
}
162+
144163
/**
145164
* Pop the next job off of the queue.
146165
*

0 commit comments

Comments
 (0)