You are here

function background_process_cron_alter in Background Process 6

Same name and namespace in other branches
  1. 8 background_process.module \background_process_cron_alter()
  2. 7 background_process.module \background_process_cron_alter()

Implements hook_cron_alter().

File

./background_process.module, line 222

Code

function background_process_cron_alter(&$items) {
  $items['background_process_cron']['override_congestion_protection'] = TRUE;

  // Unlock background if too old.
  // @todo Move to some access handler or pre-execute?
  if ($process = background_process_get_process('uc:background_process_cron')) {
    if ($process->start + 30 < time()) {
      background_process_unlock($process->handle, t('Self unlocking stale lock'), $process->start);
    }
  }
}