Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix-547: Eliminated legacy cron error. #548

Open
wants to merge 1 commit into
base: MOODLE_310_STABLE
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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