Fix overriding cron token

This commit is contained in:
Pavel Dohnal
2018-07-31 15:38:30 +01:00
committed by Rostislav Wolny
parent 38d078df5e
commit a3b79a6907
4 changed files with 75 additions and 72 deletions

View File

@ -61,12 +61,10 @@ class Daemon {
$this->executePremiumKeyCheckWorker();
$this->executeBounceWorker();
} catch(\Exception $e) {
$daemon['last_error'] = $e->getMessage();
CronHelper::saveDaemon($daemon);
CronHelper::saveDaemonLastError($e->getMessage());
}
// Log successful execution
$daemon['run_completed_at'] = time();
CronHelper::saveDaemon($daemon);
CronHelper::saveDaemonRunCompleted(time());
// if workers took less time to execute than the daemon execution limit,
// pause daemon execution to ensure that daemon runs only once every X seconds
$elapsed_time = microtime(true) - $this->timer;
@ -137,4 +135,4 @@ class Daemon {
$daemon['token'] !== $this->token ||
(isset($daemon['status']) && $daemon['status'] !== CronHelper::DAEMON_STATUS_ACTIVE);
}
}
}