From f800abeea4f6c68182c51cd4aaea19d7636431c8 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 9 Oct 2019 17:31:19 +0200 Subject: [minilinux] Rewrite for multiple version/sources handling * You can supply multiple sources for updates (URLs) * Sources can provide multiple branches * Each branch can supply multiple versions (eg. updates) TODO: Set global default version TODO: Supply hook to serversetup-ipxe to add specific boot entries TODO: UX polish TODO: phpdoc/polish --- inc/taskmanager.inc.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'inc/taskmanager.inc.php') diff --git a/inc/taskmanager.inc.php b/inc/taskmanager.inc.php index 8fe70d00..547a75d4 100644 --- a/inc/taskmanager.inc.php +++ b/inc/taskmanager.inc.php @@ -175,6 +175,22 @@ class Taskmanager return false; } + /** + * Check whether the given task is running, that is either waiting for execution + * or currently executing. + * + * @param array $task struct representing task, obtained by ::status + * @return boolean true if task is waiting or executing, false if waiting for execution or currently executing, no valid task, etc. + */ + public static function isRunning($task) + { + if (!is_array($task) || !isset($task['statusCode']) || !isset($task['id'])) + return false; + if ($task['statusCode'] === Taskmanager::TASK_WAITING || $task['statusCode'] === Taskmanager::TASK_PROCESSING) + return true; + return false; + } + public static function addErrorMessage($task) { static $failure = false; -- cgit v1.2.3-55-g7522