From 06531eecb87e8f2aeee1e1be0b7c1f270ad61f22 Mon Sep 17 00:00:00 2001 From: Sohrab Date: Fri, 17 Jun 2022 19:01:53 -0700 Subject: [PATCH] Update FairQueueServiceProvider.php --- src/FairQueueServiceProvider.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/FairQueueServiceProvider.php b/src/FairQueueServiceProvider.php index a401237..1719e6c 100644 --- a/src/FairQueueServiceProvider.php +++ b/src/FairQueueServiceProvider.php @@ -92,9 +92,13 @@ protected function registerQueueEvents(): void Queue::after(function (JobProcessed $event) { $redis = FairQueue::getConnection(); $payload = $event->job->payload(); + if (!isset($payload['data']) || !isset($payload['data']['command'])) { + return; + } $command = unserialize($payload['data']['command']); - if(!$command instanceof FairSignalJob) + if (!$command instanceof FairSignalJob) { return; + } $queue = $command->queue; $partition = $command->partition; $past_minute_key = $this->partitionProcessedJobsInPastMinutesKey($queue, $partition, 1);