function background_process_get_process in Background Process 7
Same name and namespace in other branches
- 8 background_process.module \background_process_get_process()
- 6 background_process.module \background_process_get_process()
- 7.2 background_process.module \background_process_get_process()
Get background process.
Parameters
string $handle: Handle of background process
Return value
object Background process
10 calls to background_process_get_process()
- BackgroundProcess::lock in ./
BackgroundProcess.class.php - background_process_ass_cron_alter in background_process_ass/
background_process_ass.module - Implements hook_cron_alter().
- background_process_cron_alter in ./
background_process.module - Implements hook_cron_alter().
- background_process_keepalive in ./
background_process.module - Keep process alive.
- background_process_service_access in ./
background_process.module - Access handler for service call.
File
- ./
background_process.module, line 776
Code
function background_process_get_process($handle) {
try {
$old_db = db_set_active('background_process');
$result = db_select('background_process', 'bp')
->fields('bp', array(
'handle',
'callback',
'args',
'uid',
'token',
'service_host',
'start_stamp',
'exec_status',
))
->condition('handle', $handle)
->execute()
->fetchObject();
db_set_active($old_db);
} catch (Exception $e) {
db_set_active($old_db);
throw $e;
}
if ($result) {
$result->args = unserialize($result->args);
$result->callback = unserialize($result->callback);
$result->start = $result->start_stamp;
$result->status = $result->exec_status;
return $result;
}
return FALSE;
}