From 1b28ca2520ec230cd6d88488fd43c37436833b8f Mon Sep 17 00:00:00 2001 From: Daniel Ziegenberg Date: Fri, 27 May 2022 18:30:29 +0200 Subject: [PATCH] MDL-63594 core: Final deprecation and removal of cron_run_single_task() Signed-off-by: Daniel Ziegenberg --- lib/deprecatedlib.php | 16 +++------------- lib/upgrade.txt | 3 ++- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php index 9d9208c882c..92385cba87f 100644 --- a/lib/deprecatedlib.php +++ b/lib/deprecatedlib.php @@ -2869,22 +2869,12 @@ function get_module_metadata($course, $modnames, $sectionreturn = null) { } /** - * Runs a single cron task. This function assumes it is displaying output in pseudo-CLI mode. - * - * The function will fail if the task is disabled. - * - * Warning: Because this function closes the browser session, it may not be safe to continue - * with other processing (other than displaying the rest of the page) after using this function! - * * @deprecated since Moodle 3.9 MDL-63580. Please use the \core\task\manager::run_from_cli($task). - * @todo final deprecation. To be removed in Moodle 4.1 MDL-63594. - * @param \core\task\scheduled_task $task Task to run - * @return bool True if cron run successful */ function cron_run_single_task(\core\task\scheduled_task $task) { - debugging('cron_run_single_task() is deprecated. Please use \\core\task\manager::run_from_cli() instead.', - DEBUG_DEVELOPER); - return \core\task\manager::run_from_cli($task); + throw new coding_exception( + 'cron_run_single_task() has been removed. Please use \\core\task\manager::run_from_cli() instead.' + ); } /** diff --git a/lib/upgrade.txt b/lib/upgrade.txt index f4fcd3a0298..6de407576bf 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -3,7 +3,8 @@ information provided here is intended especially for developers. === 4.1 === -* The method ensure_adhoc_task_qos() in lib/classes/task/manager.php has been deprecated, please use get_next_adhoc_task() +* Final deprecation and removal of cron_run_single_task(), please use \core\task\manager::run_from_cli(). +* The method ensure_adhoc_task_qos() in lib/classes/task/manager.php has been deprecated, please use get_next_adhoc_task() instead. * New setting $CFG->enrolments_sync_interval controls the minimum time in seconds between re-synchronization of enrollment via enrol_check_plugins. This only applies to web requests without a session such as webservice calls, tokenpluginfile.php and rss links Function