You are here

function _hosting_get_new_tasks in Hosting 6.2

Same name and namespace in other branches
  1. 5 hosting.queues.inc \_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.

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 913
Web server node type is defined here.

Code

function _hosting_get_new_tasks($limit = 20) {
  $return = array();
  $result = db_query("SELECT t.nid\n    FROM {hosting_task} t\n    INNER JOIN {node} n ON t.vid = n.vid\n    WHERE t.task_status = %d GROUP BY t.rid ORDER BY n.changed, n.nid ASC LIMIT %d", HOSTING_TASK_QUEUED, $limit);
  while ($node = db_fetch_object($result)) {
    $return[$node->nid] = node_load($node->nid);
  }
  return $return;
}