From: Matthias Schmidt Date: Sun, 28 Apr 2013 08:12:45 +0000 (+0200) Subject: Updates cronjob fail counter during manual cronjob execution X-Git-Tag: 2.0.0_Beta_1~274^2~8 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b31d507d32f8cfe9793840a35e8896b4c83e3703;p=GitHub%2FWoltLab%2FWCF.git Updates cronjob fail counter during manual cronjob execution …and disables failed cronjob if it failed too often --- diff --git a/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php b/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php index ce1835b7ad..99996f272f 100644 --- a/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php +++ b/wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php @@ -158,6 +158,17 @@ class CronjobAction extends AbstractDatabaseObjectAction implements IToggleActio $data['isDisabled'] = 0; } } + // cronjob failed + else { + if ($cronjob->failCount < Cronjob::MAX_FAIL_COUNT) { + $data['failCount'] = $cronjob->failCount + 1; + } + + // cronjob failed too often: disable it + if ($cronjob->failCount + 1 == Cronjob::MAX_FAIL_COUNT) { + $data['isDisabled'] = 1; + } + } $cronjob->update($data);