This commit is contained in:
Juan Pablo Vial
2025-05-12 19:46:09 -04:00
parent 3006adb0f7
commit f14cdd2730
10 changed files with 268 additions and 21 deletions

View File

@ -44,7 +44,7 @@ class Queue extends Ideal\Service
return false;
}
$status = true;
$errors = [];
foreach ($jobs as $job) {
$type = 'default';
if (isset($job->configuration['type'])) {
@ -57,13 +57,15 @@ class Queue extends Ideal\Service
$worker = $this->workers[$type];
try {
$status &= $worker->run($job);
if (!$worker->execute($job)) {
$errors []= $job->id;
}
} catch (Exception $exception) {
$final = new Exception("Could not run job", 0, $exception);
$this->logger->warning($final);
$status &= false;
$errors []= $job->id;
}
}
return $status;
return count($errors) === 0;
}
}