Skip to content

Commit

Permalink
Update FairQueueServiceProvider.php
Browse files Browse the repository at this point in the history
  • Loading branch information
SohrabZ authored Jun 18, 2022
1 parent c2dfcaf commit 06531ee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/FairQueueServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 06531ee

Please sign in to comment.