function _hosting_get_new_tasks

7.x-3.x hosting_task.module _hosting_get_new_tasks($limit = 20)

Retrieve a list of outstanding tasks.

Parameters

int $limit: The amount of items to return.

Return value

array An associative array containing task nodes, indexed by node id.

3 calls to _hosting_get_new_tasks()
drush_hosting_queued in queued/hosting_queued.drush.inc
Drush command to execute hosting tasks.
hosting_QUEUE_TYPE_queue in ./hosting.api.php
Process the specified queue.
hosting_tasks_queue in task/hosting_task.module
Process the hosting task queue.

File

task/hosting_task.module, line 1267
Web server node type is defined here.

Code

function _hosting_get_new_tasks($limit = 20) {
  $return = array();
  $result = db_query_range("SELECT t.nid
    FROM {hosting_task} t
    INNER JOIN {node} n
    ON t.vid = n.vid
    WHERE t.task_status = :task_status
    GROUP BY t.rid
    ORDER BY n.changed, n.nid ASC", 0, $limit, array(
    ':task_status' => HOSTING_TASK_QUEUED,
  ));
  foreach ($result as $node) {
    $return[$node->nid] = node_load($node->nid);
  }
  return $return;
}