You are here

function hosting_tasks_queue in Hosting 7.4

Same name and namespace in other branches
  1. 5 hosting.queues.inc \hosting_tasks_queue()
  2. 6.2 task/hosting_task.module \hosting_tasks_queue()
  3. 7.3 task/hosting_task.module \hosting_tasks_queue()

Process the hosting task queue.

Iterates through the list of outstanding tasks, and execute the commands on the back end.

File

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

Code

function hosting_tasks_queue($count = 20) {
  global $provision_errors;
  $tasks = hosting_get_new_tasks($count);
  if (count($tasks)) {
    drush_log(dt("Found @count tasks (max @max) in queue. Running...", array(
      '@count' => count($tasks),
      '@max' => $count,
    )), "ok");
  }
  else {
    drush_log(dt("Found no tasks in queue. Not running."), "ok");
  }
  foreach ($tasks as $task) {
    hosting_task_execute($task, array(
      'fork' => drush_get_option('fork', TRUE),
    ));
  }
}