Queue runs batch of jobs
This commit is contained in:
@ -42,7 +42,14 @@ class Queue extends Command
|
||||
}
|
||||
|
||||
$io->title("[{$now->format('Y-m-d H:i:s e')}] Running Queue...");
|
||||
return $this->runJob();
|
||||
$results = [];
|
||||
for ($i = 0; $i < $this->batchSize; $i++) {
|
||||
if ($this->jobService->getPending() === 0) {
|
||||
break;
|
||||
}
|
||||
$results []= $this->runJob();
|
||||
}
|
||||
return count(array_filter($results, fn ($result) => $result === self::FAILURE)) === 0 ? self::SUCCESS : self::FAILURE;
|
||||
}
|
||||
|
||||
protected array $sections;
|
||||
|
Reference in New Issue
Block a user