set last run of letsencrypt cron when called in webserver-cron

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2019-07-11 08:39:26 +02:00
parent 8b417c044c
commit db3c95ea10
3 changed files with 13 additions and 11 deletions

View File

@@ -35,6 +35,8 @@ class HttpConfigBase
\Froxlor\FroxlorLogger::getInstanceOf()->logAction(\Froxlor\FroxlorLogger::CRON_ACTION, LOG_INFO, 'Running Let\'s Encrypt cronjob prior to regenerating webserver config files');
\Froxlor\Cron\Http\LetsEncrypt\AcmeSh::$no_inserttask = true;
\Froxlor\Cron\Http\LetsEncrypt\AcmeSh::run();
// set last run timestamp of cronjob
\Froxlor\System\Cronjob::updateLastRunOfCron('letsencrypt');
}
}

View File

@@ -96,7 +96,7 @@ class MasterCron extends \Froxlor\Cron\FroxlorCron
if (count($jobs_to_run) > 0) {
// include all jobs we want to execute
foreach ($jobs_to_run as $cron) {
self::updateLastRunOfCron($cron);
\Froxlor\System\Cronjob::updateLastRunOfCron($cron);
$cronfile = self::getCronModule($cron);
if ($cronfile && class_exists($cronfile)) {
$cronfile::run();
@@ -336,16 +336,6 @@ class MasterCron extends \Froxlor\Cron\FroxlorCron
}
}
private static function updateLastRunOfCron($cronname)
{
$upd_stmt = Database::prepare("
UPDATE `" . TABLE_PANEL_CRONRUNS . "` SET `lastrun` = UNIX_TIMESTAMP() WHERE `cronfile` = :cron;
");
Database::pexecute($upd_stmt, array(
'cron' => $cronname
));
}
private static function getCronModule($cronname)
{
$upd_stmt = Database::prepare("