summaryrefslogtreecommitdiffstats
path: root/inc/taskmanager.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/taskmanager.inc.php')
-rw-r--r--inc/taskmanager.inc.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/inc/taskmanager.inc.php b/inc/taskmanager.inc.php
index 528b3f78..dd16c62d 100644
--- a/inc/taskmanager.inc.php
+++ b/inc/taskmanager.inc.php
@@ -80,6 +80,20 @@ 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.
+ *
+ * @param string $taskid a task id
+ * @return boolean true if taskid exists in taskmanager
+ */
+ public static function isTask($taskid)
+ {
+ $task = self::status($taskid);
+ return isset($task['statusCode']) && $task['statusCode'] !== NO_SUCH_TASK;
+ }
+
+ /**
* Wait for the given task's completion.
*
* @param type $task task to wait for