diff options
author | Simon Rettberg | 2017-04-10 12:03:16 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-04-10 12:03:16 +0200 |
commit | 76d9ed010bd72fa01c39c7e66a90546d70be0c10 (patch) | |
tree | 7c514f7115efd581439218482835912fc7db0adf | |
parent | Update translations (diff) | |
download | slx-admin-76d9ed010bd72fa01c39c7e66a90546d70be0c10.tar.gz slx-admin-76d9ed010bd72fa01c39c7e66a90546d70be0c10.tar.xz slx-admin-76d9ed010bd72fa01c39c7e66a90546d70be0c10.zip |
[apis/cron] Try to catch exceptions when running module cron handler
-rw-r--r-- | apis/cron.inc.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apis/cron.inc.php b/apis/cron.inc.php index 0bcd2490..cf96ac29 100644 --- a/apis/cron.inc.php +++ b/apis/cron.inc.php @@ -52,6 +52,11 @@ foreach (Hook::load('cron') as $hook) { } $value = $hook->moduleId . '|' . time(); Property::addToList(CRON_KEY_STATUS, $value, 1800); - handleModule($hook->file); + try { + handleModule($hook->file); + } catch (Exception $e) { + // Logging + EventLog::failure('Cronjob for module ' . $hook->moduleId . ' has crashed. Check the php or web server error log.', $e->toString()); + } Property::removeFromList(CRON_KEY_STATUS, $value); } |