You are here

function _advancedqueue_cleanup_table in Advanced Queue 7

Helper function to clean the advancedqueue table.

2 calls to _advancedqueue_cleanup_table()
advancedqueue_cron in ./advancedqueue.module
Implements hook_cron().
drush_advancedqueue_process_queue in drush/advancedqueue.drush.inc
Command callback for drush advancedqueue-process-queue.

File

./advancedqueue.module, line 307
Helper module for advanced queuing.

Code

function _advancedqueue_cleanup_table() {

  // Purge processed items beyond a chosen threshold.
  $preserve_rows = variable_get('advancedqueue_threshold', 0);
  if ($preserve_rows) {

    // No limit means we don't remove old entries.
    _advancedqueue_purge_history($preserve_rows);
  }

  // Clean up timed out items stuck in ADVANCEDQUEUE_STATUS_PROCESSING.
  $timeout = variable_get('advancedqueue_release_timeout', 0);
  if ($timeout) {

    // No timeout means we don't touch stale items.
    _advancedqueue_release_stale_items($timeout);
  }
}