Skip to content

Commit

Permalink
fix: check for pending jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
rugbymauri committed Aug 15, 2023
1 parent d3ef159 commit fcc782e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Manager/ExecutionManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ public function isRunNeeded(CronInterface $cronJob, int $checkInterval = 15): bo
return false;
}

// Check for pending
$pendingExcecution = $this->getPendingExecution($cronJob);
if ($pendingExcecution) {
$this->logger->debug(sprintf('%s has pending exection. Scheduling it now.', $cronJob::class));
$this->cleanupPending($cronJob);

return true;
}


$nextExecutionDate = (new CronExpression($cronJob->getExpression()))
->getNextRunDate('-' . $checkInterval .' seconds');

Expand Down

0 comments on commit fcc782e

Please sign in to comment.