diff --git a/lib/classes/task/manager.php b/lib/classes/task/manager.php index af6bccf3895..1f34954b041 100644 --- a/lib/classes/task/manager.php +++ b/lib/classes/task/manager.php @@ -99,6 +99,9 @@ class manager { $classname = '\\' . $classname; } + // For tasks, the first run should also follow the schedule. + $task->set_next_run_time($task->get_next_scheduled_time()); + // If there is an existing task with a custom schedule, do not override it. $currenttask = self::get_scheduled_task($classname); if ($currenttask && $currenttask->is_customised()) {