You are here

function hosting_task_update_2 in Hosting 7.3

Same name and namespace in other branches
  1. 5 task/hosting_task.install \hosting_task_update_2()
  2. 6.2 task/hosting_task.install \hosting_task_update_2()
  3. 7.4 task/hosting_task.install \hosting_task_update_2()

Implements hook_update_N().

Reset the task_status of all currently (according to us) in queue tasks

This will force them to be re-evaluated if the queue status doesn't match the task status

File

task/hosting_task.install, line 158
Define the database schema and update functions for the hosting_task module.

Code

function hosting_task_update_2() {
  $ret = array();
  variable_set('hosting_dispatch_enabled', FALSE);

  // Put the queued items separately for a bit.
  db_query("UPDATE {hosting_task_queue} SET status = 100 WHERE status = 0");

  // Remove all the other items from the queue.
  db_query("UPDATE {hosting_task_queue} SET status = 0 WHERE status <> 100");

  // Add all the queued items back into the queue.
  db_query("UPDATE {hosting_task_queue} SET status = 1 WHERE status = 100");
  variable_set('hosting_dispatch_enabled', TRUE);
  return $ret;
}