Skip to content

Commit

Permalink
Merge pull request #38 from aloware/fix/tries-undefined-property
Browse files Browse the repository at this point in the history
Fix `$tries` Undefined Property
  • Loading branch information
hamed-aloware authored Nov 7, 2022
2 parents 57b15e2 + fc0a9dd commit 2287f72
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/FairSignalJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public function handle()
}

try {
$job->tries++;
if(isset($job->tries)) {
$job->tries++;
}

if (isset($job->uuid)) {
$repository->expectAcknowledge(
Expand Down Expand Up @@ -84,7 +86,7 @@ public function handle()

$maxTries = $this->getQueueTries($this->queue);

if ($job->tries >= $maxTries) {
if (!isset($job->tries) || $job->tries >= $maxTries) {
$repository->pushFailed($this->queue, $partition, $jobSerialized);
} else {
$repository->lPush($this->queue, $partition, $jobSerialized);
Expand Down

0 comments on commit 2287f72

Please sign in to comment.