Skip to content

Commit

Permalink
Merge pull request #576 from sammarshallou/remove-cronlib-inclusion
Browse files Browse the repository at this point in the history
Removed legacy cron function
  • Loading branch information
danmarsden authored Jul 29, 2024
2 parents 435d8db + dd0d2a4 commit 0a55f98
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
16 changes: 0 additions & 16 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions tests/local/tasks_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 0a55f98

Please sign in to comment.