function background_process_lock_process in Background Process 8
Same name and namespace in other branches
- 6 background_process.module \background_process_lock_process()
- 7 background_process.module \background_process_lock_process()
Implements to Lock process.
1 call to background_process_lock_process()
- BackgroundProcess::lock in ./
background_process.class.php - Implements to Lock the Background Process.
File
- ./
background_process.module, line 594 - This module implements a framework for calling funtions in the background.
Code
function background_process_lock_process($handle, $status = BACKGROUND_PROCESS_STATUS_LOCKED) {
try {
$old_db = Database::setActiveConnection('background_process');
db_insert('background_process')
->fields([
'handle' => $handle,
'start_stamp' => sprintf("%.06f", microtime(TRUE)),
'exec_status' => $status,
])
->execute();
Database::setActiveConnection($old_db);
_background_process_ensure_cleanup($handle);
return TRUE;
} catch (Exception $e) {
Database::setActiveConnection($old_db);
return FALSE;
}
}