From a75e8c98b8ed96b60aadd540bf5a899fa18e1267 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 22 Aug 2011 19:08:21 +0200 Subject: [PATCH] Fixed calculation of afterNextExec The timebase for calculation of `afterNextExec` is equal to `nextExec` in order to find any date after this time for execution. Unfortunately this timebase is already a valid date and thus is used as result (now `nextExec` and `afterNextExec` are equal). To fix this, we simply add 1 to the `nextExec` timestamp, making it an invalid date for next execution (we do not support seconds anyway!). --- wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php | 2 +- .../install/files/lib/system/cronjob/CronjobScheduler.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php b/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php index 4692331d12..2654c5efe1 100644 --- a/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php +++ b/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php @@ -135,7 +135,7 @@ class CronjobAction extends AbstractDatabaseObjectAction { $nextExec = $cronjob->getNextExec(); $cronjob->update(array( 'nextExec' => $nextExec, - 'afterNextExec' => $cronjob->getNextExec($nextExec) + 'afterNextExec' => $cronjob->getNextExec(($nextExec + 1)) )); // build the return value diff --git a/wcfsetup/install/files/lib/system/cronjob/CronjobScheduler.class.php b/wcfsetup/install/files/lib/system/cronjob/CronjobScheduler.class.php index e17d925d2e..bb243c3398 100644 --- a/wcfsetup/install/files/lib/system/cronjob/CronjobScheduler.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/CronjobScheduler.class.php @@ -78,7 +78,7 @@ class CronjobScheduler extends SingletonFactory { // get time of next execution $nextExec = $cronjobEditor->getNextExec(); - $afterNextExec = $cronjobEditor->getNextExec($nextExec); + $afterNextExec = $cronjobEditor->getNextExec(($nextExec + 1)); // mark cronjob as done $cronjobEditor->update(array( -- 2.20.1