Skip to content

Commit

Permalink
[9.x] Enable batch jobs delay for SQS queue (#41788)
Browse files Browse the repository at this point in the history
* [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]>
  • Loading branch information
civilcoder55 and taylorotwell authored Apr 2, 2022
1 parent 15b76f5 commit 8326ba8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Illuminate/Queue/SqsQueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,25 @@ function ($payload, $queue, $delay) {
);
}

/**
* Push an array of jobs onto the queue.
*
* @param array $jobs
* @param mixed $data
* @param string|null $queue
* @return void
*/
public function bulk($jobs, $data = '', $queue = null)
{
foreach ((array) $jobs as $job) {
if (isset($job->delay)) {
$this->later($job->delay, $job, $data, $queue);
} else {
$this->push($job, $data, $queue);
}
}
}

/**
* Pop the next job off of the queue.
*
Expand Down

0 comments on commit 8326ba8

Please sign in to comment.