Skip to content

Commit

Permalink
fix init execution
Browse files Browse the repository at this point in the history
  • Loading branch information
fashxp committed Dec 14, 2021
1 parent a66af52 commit 2f1b7a4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Processing/Cron/CronExecutionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,14 @@ public function updateExecutionTimestamp(string $configName, \DateTime $executio

public function initExecution(string $configName)
{
$timestamp = $this->getDb()->fetchOne(
try {
$timestamp = $this->getDb()->fetchOne(
sprintf('SELECT lastExecutionDate FROM %s WHERE configName = ?', self::EXECUTION_STORAGE_TABLE_NAME),
[$configName]
);
} catch (TableNotFoundException $exception) {
$timestamp = false;
}

if ($timestamp === false) {
$this->updateExecutionTimestamp($configName, new \DateTime());
Expand Down

0 comments on commit 2f1b7a4

Please sign in to comment.