Merge branch 'MDL-68631' of https://github.com/jonof/moodle
authorJake Dallimore <jake@moodle.com>
Wed, 13 May 2020 01:24:30 +0000 (09:24 +0800)
committerJake Dallimore <jake@moodle.com>
Wed, 13 May 2020 01:24:30 +0000 (09:24 +0800)
lib/cronlib.php

index 917e5b5..bea9252 100644 (file)
@@ -275,6 +275,8 @@ function cron_run_inner_scheduled_task(\core\task\task_base $task) {
         }
         \core\task\manager::scheduled_task_failed($task);
     } finally {
+        // Reset back to the standard admin user.
+        cron_setup_user();
         cron_prepare_core_renderer(true);
     }
     get_mailer('close');