summaryrefslogtreecommitdiffstats
path: root/apis
diff options
context:
space:
mode:
authorSimon Rettberg2022-07-04 15:42:13 +0200
committerSimon Rettberg2022-07-04 15:42:13 +0200
commit878dbac85a9f684916e2d30cab4782e21a03e767 (patch)
treee4e8edc6e61b10c1f6bc15f12a1d9c09677a3103 /apis
parentFix typos (diff)
downloadslx-admin-878dbac85a9f684916e2d30cab4782e21a03e767.tar.gz
slx-admin-878dbac85a9f684916e2d30cab4782e21a03e767.tar.xz
slx-admin-878dbac85a9f684916e2d30cab4782e21a03e767.zip
[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.
Diffstat (limited to 'apis')
-rw-r--r--apis/cron.inc.php10
1 files changed, 5 insertions, 5 deletions
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);
}