function hosting_task_parse_log in Hosting 6.2
Same name and namespace in other branches
- 7.4 task/hosting_task.module \hosting_task_parse_log()
- 7.3 task/hosting_task.module \hosting_task_parse_log()
Parse a task's log, and return its status accordingly.
Parameters
The revision ID of a task node.:
Return value
The task's status error code.
1 call to hosting_task_parse_log()
- hosting_task_update_status in task/
hosting_task.module - Set a task's status according to its log.
File
- task/
hosting_task.module, line 1332 - Web server node type is defined here.
Code
function hosting_task_parse_log($vid) {
// Assume the best
$update = HOSTING_TASK_SUCCESS;
$result = db_query('SELECT type FROM {hosting_task_log} WHERE vid = %d', $vid);
while ($status = db_result($result)) {
if ($status == 'error' || $status == 'failed') {
$update = HOSTING_TASK_ERROR;
}
elseif ($update != HOSTING_TASK_ERROR && $status == 'warning') {
$update = HOSTING_TASK_WARNING;
}
}
return $update;
}