function background_process_get_processes in Background Process 8
Same name and namespace in other branches
- 6 background_process.module \background_process_get_processes()
- 7 background_process.module \background_process_get_processes()
Get background process.
2 calls to background_process_get_processes()
- background_process_ass_auto_unlock in background_process_ass/
background_process_ass.module - Implements to Unlock locked processes that aren't really running.
- DefaultController::backgroundProcessOverviewPage in src/
Controller/ DefaultController.php - Implements Background Process Overview Page.
File
- ./
background_process.module, line 664 - This module implements a framework for calling funtions in the background.
Code
function background_process_get_processes($status = NULL) {
$old_db = Database::setActiveConnection('background_process');
$result = db_select('background_process', 'bp')
->fields('bp', [
'handle',
'callback',
'args',
'uid',
'token',
'service_host',
'start_stamp',
'exec_status',
]);
if (isset($status)) {
$result = $result
->condition('bp.status', $status);
}
$result = $result
->execute();
$processes = [];
while ($process = $result
->fetchObject()) {
$process->args = unserialize($process->args);
$process->callback = unserialize($process->callback);
$process->start = $process->start_stamp;
$process->status = $process->exec_status;
$processes[] = $process;
}
Database::setActiveConnection($old_db);
return $processes;
}