/** * Save job result * * @param ilCronJob $a_job * @param ilCronJobResult $a_result * @param bool $a_manual */ protected static function updateJobResult(ilCronJob $a_job, ilCronJobResult $a_result, $a_manual = false) { global $ilDB, $ilUser; $user_id = $a_manual ? $ilUser->getId() : 0; $sql = "UPDATE cron_job SET " . " job_result_status = " . $ilDB->quote($a_result->getStatus(), "integer") . " , job_result_user_id = " . $ilDB->quote($user_id, "integer") . " , job_result_code = " . $ilDB->quote($a_result->getCode(), "text") . " , job_result_message = " . $ilDB->quote($a_result->getMessage(), "text") . " , job_result_type = " . $ilDB->quote($a_manual, "integer") . " , job_result_ts = " . $ilDB->quote(time(), "integer") . " , job_result_dur = " . $ilDB->quote($a_result->getDuration() * 1000, "integer") . " WHERE job_id = " . $ilDB->quote($a_job->getId(), "text"); $ilDB->manipulate($sql); }