You are here

function _background_process_ass_unlock in Background Process 6

Same name and namespace in other branches
  1. 8 background_process_ass/background_process_ass.module \_background_process_ass_unlock()
  2. 7.2 background_process_ass/background_process_ass.module \_background_process_ass_unlock()
  3. 7 background_process_ass/background_process_ass.module \_background_process_ass_unlock()
1 call to _background_process_ass_unlock()
background_process_ass_auto_unlock in background_process_ass/background_process_ass.module
Unlock locked processes that aren't really running.

File

background_process_ass/background_process_ass.module, line 219
@todo Implement admin interface. @todo Fix runtime check of running process.

Code

function _background_process_ass_unlock($process) {
  watchdog('bg_process', 'Unlocking: ' . $process->handle);
  if ($process->status == BACKGROUND_PROCESS_STATUS_RUNNING) {
    $msg = t('Died unexpectedly (auto unlock due to missing connection)');

    // Unlock the process
    if (background_process_unlock($process->handle, $msg, $process->start)) {
      drupal_set_message(t("%handle unlocked: !msg", array(
        '%handle' => $process->handle,
        '!msg' => $msg,
      )));
    }
  }
}