Skip to content

Commit

Permalink
Merge pull request #122 from marcusrettig/master
Browse files Browse the repository at this point in the history
  • Loading branch information
mnapoli committed Jun 21, 2023
2 parents 3bd8c34 + ae5f94c commit d625dab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Queue/QueueHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Illuminate\Container\Container;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Contracts\Debug\ExceptionHandler;
use Illuminate\Contracts\Cache\Repository as Cache;

use Bref\LaravelBridge\MaintenanceMode;

Expand Down Expand Up @@ -78,10 +79,15 @@ public function __construct(
*/
public function handleSqs(SqsEvent $event, Context $context): void
{
/** @var Worker $worker */
$worker = $this->container->makeWith(Worker::class, [
'isDownForMaintenance' => fn () => MaintenanceMode::active(),
]);

$worker->setCache(
$this->container->make(Cache::class)
);

foreach ($event->getRecords() as $sqsRecord) {
$timeout = $this->calculateJobTimeout($context->getRemainingTimeInMillis());

Expand Down

0 comments on commit d625dab

Please sign in to comment.