You are here

function _background_process_ass_unlock in Background Process 8

Same name and namespace in other branches
  1. 6 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()

Implements to Unlock Process Ass.

1 call to _background_process_ass_unlock()
background_process_ass_auto_unlock in background_process_ass/background_process_ass.module
Implements to Unlock locked processes that aren't really running.

File

background_process_ass/background_process_ass.module, line 181
Implements Background Process Ass Module. @todo Implement admin interface. @todo Fix runtime check of running process.

Code

function _background_process_ass_unlock($process) {
  \Drupal::logger('bg_process')
    ->notice('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", [
        '%handle' => $process->handle,
        '!msg' => $msg,
      ]));
    }
  }
}