summaryrefslogtreecommitdiffstats
path: root/apis
diff options
context:
space:
mode:
authorSimon Rettberg2017-04-10 12:03:16 +0200
committerSimon Rettberg2017-04-10 12:03:16 +0200
commit76d9ed010bd72fa01c39c7e66a90546d70be0c10 (patch)
tree7c514f7115efd581439218482835912fc7db0adf /apis
parentUpdate translations (diff)
downloadslx-admin-76d9ed010bd72fa01c39c7e66a90546d70be0c10.tar.gz
slx-admin-76d9ed010bd72fa01c39c7e66a90546d70be0c10.tar.xz
slx-admin-76d9ed010bd72fa01c39c7e66a90546d70be0c10.zip
[apis/cron] Try to catch exceptions when running module cron handler
Diffstat (limited to 'apis')
-rw-r--r--apis/cron.inc.php7
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);
}