You are here

function background_process_cron_alter in Background Process 8

Same name and namespace in other branches
  1. 6 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 152
This module implements a framework for calling funtions in the background.

Code

function background_process_cron_alter(&$items) {
  $items['background_process_cron']['override_congestion_protection'] = TRUE;
  $handle_prefix = \Drupal::config('ultimate_cron_handle_prefix')
    ->get('uc:');
  if ($process = background_process_get_process($handle_prefix . 'background_process_cron')) {
    if ($process->start + 30 < time()) {
      background_process_unlock($process->handle, t('Self unlocking stale lock'), $process->start);
    }
  }
}