MDL-80749 adhoc_task: Log the first starting time of the task

This commit is contained in:
Huong Nguyen
2024-03-04 10:17:09 +07:00
parent debed3eace
commit 17c01d9d74
5 changed files with 93 additions and 2 deletions
+7
View File
@@ -1227,6 +1227,13 @@ class manager {
$task->set_pid($pid);
$record = self::record_from_adhoc_task($task);
// If this is the first time the task has been started, then set the first starting time.
$firststartingtime = $DB->get_field('task_adhoc', 'firststartingtime', ['id' => $record->id]);
if (is_null($firststartingtime)) {
$record->firststartingtime = $time;
}
$DB->update_record('task_adhoc', $record);
self::task_starting($task);