function _hosting_get_new_tasks in Hostmaster (Aegir) 6
Retrieve a list of outstanding tasks.
Parameters
limit: The amount of items to return.
Return value
An associative array containing task nodes, indexed by node id.
Related topics
2 calls to _hosting_get_new_tasks()
- hosting_QUEUE_TYPE_queue in modules/
hosting/ hosting.api.php - Process the specified queue.
- hosting_tasks_queue in modules/
hosting/ hosting.queues.inc - Process the hosting task queue.
File
- modules/
hosting/ hosting.queues.inc, line 153 - This file defines an API for defining new queues.
Code
function _hosting_get_new_tasks($limit = 20) {
$return = array();
$result = db_query("SELECT t.nid FROM {hosting_task} t INNER JOIN {node} n ON t.vid = n.vid WHERE t.task_status = %d GROUP BY t.rid ORDER BY n.changed, n.nid ASC LIMIT %d", 0, $limit);
while ($node = db_fetch_object($result)) {
$return[$node->nid] = node_load($node->nid);
}
return $return;
}