You are here

function _hosting_get_new_tasks in Hosting 5

Same name and namespace in other branches
  1. 6.2 task/hosting_task.module \_hosting_get_new_tasks()
  2. 7.4 task/hosting_task.module \_hosting_get_new_tasks()
  3. 7.3 task/hosting_task.module \_hosting_get_new_tasks()

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.

1 call to _hosting_get_new_tasks()
hosting_tasks_queue in ./hosting.queues.inc
Process the hosting task queue.

File

./hosting.queues.inc, line 156

Code

function _hosting_get_new_tasks($limit = 20) {
  $return = array();
  $result = db_query("SELECT nid FROM {hosting_task_queue} WHERE status=1 ORDER BY timestamp, nid ASC LIMIT %d", $limit);
  while ($node = db_fetch_object($result)) {
    $return[$node->nid] = node_load($node->nid);
  }
  return $return;
}