function hosting_task_update_status in Hosting 6.2
Same name and namespace in other branches
- 7.4 task/hosting_task.module \hosting_task_update_status()
- 7.3 task/hosting_task.module \hosting_task_update_status()
Set a task's status according to its log.
Parameters
A task object or the revision ID of a task node.:
Return value
The task's status error code.
2 calls to hosting_task_update_status()
- hosting_task_drush_update_status in task/
hosting_task.drush.inc - Shutdown function to catch any task status.
- hosting_task_update_status_form_submit in task/
hosting_task.module
File
- task/
hosting_task.module, line 1308 - Web server node type is defined here.
Code
function hosting_task_update_status($task) {
if (is_numeric($task)) {
$vid = $task;
}
else {
$vid = $task->vid;
}
// Get the status of the task by parsing the log.
$status = hosting_task_parse_log($vid);
db_query('UPDATE {hosting_task} SET task_status=%d WHERE vid = %d', $status, $vid);
// Invoke hook_hosting_task_update_status()
module_invoke_all('hosting_task_update_status', $task, $status);
return $status;
}