From 878dbac85a9f684916e2d30cab4782e21a03e767 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 4 Jul 2022 15:42:13 +0200 Subject: [rebootcontrol/main] Add subkey column to property_list table This makes it easier to reference to list entries that have non-trivial data values, e.g. long json data. --- apis/cron.inc.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'apis') diff --git a/apis/cron.inc.php b/apis/cron.inc.php index 41370038..0b1e92a9 100644 --- a/apis/cron.inc.php +++ b/apis/cron.inc.php @@ -21,8 +21,8 @@ if (($report = Request::get('crashreport', false, 'string'))) { exit(0); } $str = array(); - foreach ($list as $item) { - Property::removeFromList(CRON_KEY_STATUS, $item); + foreach ($list as $subkey => $item) { + Property::removeFromListByKey(CRON_KEY_STATUS, $subkey); $entry = explode('|', $item, 2); if (count($entry) !== 2) continue; @@ -91,13 +91,13 @@ foreach (Hook::load('cron') as $hook) { $runtime = (time() - $status['start']); if ($runtime < 0) { // Clock skew - Property::removeFromList(CRON_KEY_STATUS, $status['string']); + Property::removeFromListByVal(CRON_KEY_STATUS, $status['string']); } elseif ($runtime < 900) { // Allow up to 15 minutes for a job to complete before we complain... continue; } else { // Consider job crashed - Property::removeFromList(CRON_KEY_STATUS, $status['string']); + Property::removeFromListByVal(CRON_KEY_STATUS, $status['string']); EventLog::failure('Cronjob for module ' . $hook->moduleId . ' seems to be stuck or has crashed.'); continue; } @@ -114,5 +114,5 @@ foreach (Hook::load('cron') as $hook) { // Logging EventLog::failure('Cronjob for module ' . $hook->moduleId . ' has crashed. Check the php or web server error log.', $e->getMessage()); } - Property::removeFromList(CRON_KEY_STATUS, $value); + Property::removeFromListByVal(CRON_KEY_STATUS, $value); } -- cgit v1.2.3-55-g7522