You are here

function hosting_task_count_running in Hosting 7.4

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

Return the amount of items running in the queue.

2 calls to hosting_task_count_running()
drush_hosting_pause_validate in ./pause.hosting.inc
Make sure Aegir is ready to be upgraded.
hosting_task_hosting_queues in task/hosting_task.module
Implements hook_hosting_queues().

File

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

Code

function hosting_task_count_running() {
  return db_query("SELECT COUNT(t.nid) FROM {node} n INNER JOIN {hosting_task} t ON n.vid = t.vid WHERE type = :type AND t.task_status = :task_status AND t.executed > (UNIX_TIMESTAMP() - :timeout)", array(
    ':type' => 'task',
    ':task_status' => HOSTING_TASK_PROCESSING,
    ':timeout' => 28800,
  ))
    ->fetchField();
}