streamingltd / MEDIAL-Moodle-Activity

The MEDIAL activity plugin for Moodle
GNU General Public License v3.0
3 stars 8 forks source link

Legacy cron broken by Helix mod #2

Closed aspark21 closed 4 years ago

aspark21 commented 5 years ago

We have a site with only the mod_helixmedia plugin installed. Due to the way the cron tasks are implemented in this plugin, it is causing our legacy cron task to fail because the cron for the activity is running the cron for the helixassign plugin.

Processing module function helixmedia_cron ...
... used 16852 dbqueries
... used 29.082170009613 seconds
Scheduled task failed: Legacy cron processing for plugins (core\task\legacy_plugin_cron_task),Table "assignsubmission_helixassign" does not exist
Backtrace:
* line 1521 of /lib/dml/moodle_database.php: call to moodle_database->where_clause()
* line 294 of /mod/helixmedia/lib.php: call to moodle_database->get_record()
* line 93 of /lib/classes/task/legacy_plugin_cron_task.php: call to helixmedia_cron()
* line 105 of /lib/cronlib.php: call to core\task\legacy_plugin_cron_task->execute()
* line 297 of /lib/cronlib.php: call to cron_run_inner_scheduled_task()
* line 91 of /admin/tool/task/schedule_task.php: call to cron_run_single_task()

Should really split the cron tasks up between the plugins in the helix set. Also consider creating it's own scheduled task rather than relying on legacy cron task.

aspark21 commented 5 years ago

Specifically to address this: 1)helixmedia_cron should be converted to a scheduled task https://docs.moodle.org/dev/Task_API

2)The task needs to be moved into the relevant plugin So this should be in helixassign and/or helixfeedback

N.B. Shouldn't this be $feed_installed=true

Otherwise the dependency for helixassign & helixfeedback should be added as a $plugin->dependency in version.php

Unless this is caused by our clustering incrementation.

tim1mw commented 5 years ago

Sorry for the slow reply, we don't use the Github issues for bug reports so this isn't monitored.

Converting the cron to use the scheduled tasks is on my todo list. However, not having the other plugins installed shouldn't cause a crash here, the cron job tests to see if they are present before executing the code that I suspect is causing the problem, for some reason that code thinks the plugin is installed on your system so I'll look into that.

tim1mw commented 4 years ago

Cron jobs have been converted to scheduled tasks in the 2020011201 release, so this can now close.