summaryrefslogtreecommitdiffstats
path: root/inc/taskmanager.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2018-04-25 16:47:06 +0200
committerSimon Rettberg2018-04-25 16:47:06 +0200
commitd863b362f2531c85b24b391e363380aebc917b6e (patch)
tree671342636b1447bf974ef3b8cdbe821d684c1899 /inc/taskmanager.inc.php
parent[rebootcontrol] Nicer status list; list of all running jobs (diff)
downloadslx-admin-d863b362f2531c85b24b391e363380aebc917b6e.tar.gz
slx-admin-d863b362f2531c85b24b391e363380aebc917b6e.tar.xz
slx-admin-d863b362f2531c85b24b391e363380aebc917b6e.zip
[inc/Taskmanager] isTask() Only query if taskId is given
Diffstat (limited to 'inc/taskmanager.inc.php')
-rw-r--r--inc/taskmanager.inc.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/inc/taskmanager.inc.php b/inc/taskmanager.inc.php
index ed64c613..945e759d 100644
--- a/inc/taskmanager.inc.php
+++ b/inc/taskmanager.inc.php
@@ -83,13 +83,17 @@ class Taskmanager
* Checks whether the given task id corresponds to a known task in the taskmanager.
* Returns true iff the taskmanager is reachable and the status of the task
* is different from NO_SUCH_TASK.
+ * If you pass an array it is assumed that it was already queried and is evaluated
+ * directly.
*
- * @param string $taskid a task id
+ * @param string|array $taskid a task id or a task array returned by ::status or ::submit
* @return boolean true if taskid exists in taskmanager
*/
- public static function isTask($taskid)
+ public static function isTask($task)
{
- $task = self::status($taskid);
+ if (is_string($task)) {
+ $task = self::status($task);
+ }
return isset($task['statusCode']) && $task['statusCode'] !== NO_SUCH_TASK;
}