MDL-74775 adhoc_task: Do not clear the timecreated of failed tasks

This commit is contained in:
Huong Nguyen
2024-01-29 09:57:33 +07:00
parent f30110b5eb
commit 379e48c1fd
2 changed files with 52 additions and 1 deletions
+2 -1
View File
@@ -242,6 +242,8 @@ class manager {
// Check if the task is allowed to be retried or not.
$record->attemptsavailable = $task->retry_until_success() ? self::MAX_RETRY : 1;
// Set the time the task was created.
$record->timecreated = time();
// Check if the same task is already scheduled.
if ($checkforexisting && self::task_is_scheduled($task)) {
@@ -321,7 +323,6 @@ class manager {
$record->faildelay = $task->get_fail_delay();
$record->customdata = $task->get_custom_data_as_string();
$record->userid = $task->get_userid();
$record->timecreated = time();
$record->timestarted = $task->get_timestarted();
$record->hostname = $task->get_hostname();
$record->pid = $task->get_pid();