From dd0d2a4319ffd458f0ae1c09f00b39c4a4434050 Mon Sep 17 00:00:00 2001 From: sam marshall Date: Wed, 23 Aug 2023 15:31:19 +0100 Subject: [PATCH] Removed legacy cron function This change removes the old cron function in lib.php which is no longer needed in Moodle 4.2. --- lib.php | 16 ---------------- tests/local/tasks_test.php | 7 ------- 2 files changed, 23 deletions(-) diff --git a/lib.php b/lib.php index 59159ebe..5106bcc3 100644 --- a/lib.php +++ b/lib.php @@ -69,22 +69,6 @@ define('TOOL_OBJECTFS_DELETE_EXTERNAL_TRASH', 1); define('TOOL_OBJECTFS_DELETE_EXTERNAL_FULL', 2); -// Legacy cron function. -function tool_objectfs_cron() { - mtrace('RUNNING legacy cron objectfs'); - global $CFG; - if ($CFG->branch <= 26) { - // Unlike the task system, we do not get fine grained control over - // when tasks/manipulators run. Every cron we just run all the manipulators. - (new manipulator_builder())->execute_all(); - - \tool_objectfs\local\report\objectfs_report::cleanup_reports(); - \tool_objectfs\local\report\objectfs_report::generate_status_report(); - } - - return true; -} - /** * Sends a plugin file to the browser. * @param $course diff --git a/tests/local/tasks_test.php b/tests/local/tasks_test.php index 6cae7841..8a71d024 100644 --- a/tests/local/tasks_test.php +++ b/tests/local/tasks_test.php @@ -32,13 +32,6 @@ protected function tearDown(): void { ob_end_clean(); } - public function test_run_legacy_cron() { - $config = manager::get_objectfs_config(); - $config->enabletasks = true; - manager::set_objectfs_config($config); - $this->assertTrue(tool_objectfs_cron()); - } - public function test_run_scheduled_tasks() { global $CFG; // If tasks not implemented.