MDL-52385 tasks: Queue ad-hoc tasks in future
This commit is contained in:
committed by
Andrew Nicols
parent
aeccf4bd94
commit
dfb9daeae2
@@ -135,8 +135,10 @@ class manager {
|
||||
global $DB;
|
||||
|
||||
$record = self::record_from_adhoc_task($task);
|
||||
// Schedule it immediately.
|
||||
$record->nextruntime = time() - 1;
|
||||
// Schedule it immediately if nextruntime not explicitly set.
|
||||
if (!$task->get_next_run_time()) {
|
||||
$record->nextruntime = time() - 1;
|
||||
}
|
||||
$result = $DB->insert_record('task_adhoc', $record);
|
||||
|
||||
return $result;
|
||||
|
||||
Reference in New Issue
Block a user