lucisgit / moodle-mod_panopto

Panopto resource module plugin for Moodle
https://moodle.org/plugins/mod_panopto
1 stars 1 forks source link

Add optional 'asynchronous mode' to request Panopto permissions via an adhoc task #8

Closed tonyjbutler closed 3 years ago

tonyjbutler commented 3 years ago

This adds an option to submit the remote permissions request via an adhoc task which is queued and executed when a student clicks a video link, to help prevent Moodle getting overloaded when a lot of users requests a video simultaneously. The student is presented with a progress bar while a web service method is polled via AJAX for the resulting auth url to redirect to.

It requires Moodle 3.6 minimum, as prior to this release there was no cli adhoc task runner. Relying on the normal Moodle admin cron would result in the tasks taking too long to be executed. It is recommended to run several adhoc task watchers in parallel to handle multiple concurrent requests. If a Moodle update is pending all cron tasks are suspended, so we detect this and fall back on the conventional synchronous method automatically if this is the case.