function background_process_cron_alter in Background Process 7
Same name and namespace in other branches
- 8 background_process.module \background_process_cron_alter()
- 6 background_process.module \background_process_cron_alter()
Implements hook_cron_alter().
File
- ./
background_process.module, line 186
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?
$handle_prefix = variable_get('ultimate_cron_handle_prefix', '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);
}
}
}