You are here

function drush_acquia_purge_ap_forget in Acquia Purge 6

Same name and namespace in other branches
  1. 7 acquia_purge.drush.inc \drush_acquia_purge_ap_forget()

Forget all scheduled purges and empty the queue.

File

./acquia_purge.drush.inc, line 165
Drush integration providing common maintenance tasks.

Code

function drush_acquia_purge_ap_forget() {

  // Stop invocation if we are not detecting Acquia Cloud heuristics.
  if (!_acquia_purge_are_we_on_acquiacloud()) {
    return drush_set_error("You must be on Acquia Cloud to use Acquia Purge.");
  }

  // Retrieve statistics, clear the queue and log to Drush.
  $stats = _acquia_purge_queue_stats();
  _acquia_purge_queue_clear();
  drush_log(dt("Removed @remaining items from the queue.", array(
    '@remaining' => $stats['remaining'],
  )), 'ok');

  // If there was a lock acquired, free it up as the queue will be empty now.
  lock_release('acquia_purge_ajax_processor');
}