-
Improvement
-
Resolution: Fixed
-
Minor
-
2.1.7, 2.2.4, 2.3.1
-
MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
-
MOODLE_22_STABLE, MOODLE_23_STABLE
-
Any time update_course is called (i.e. from the core update course webservice or from the GUI in the edit settings page), the last thing it does is tell the enrolment methods it's been updated.
This allows guest methods and such to update passwords and such, which is good. However, the enrol_cohort plugin performs a enrol_cohort_sync on the course! If the course has many cohorts and/or a large number of users in the cohorts, this can take a very long time to process, and so the websvc call or save action takes several minutes to return a response.
As far as I can tell, there's no reason to ever do a sync at this point. Syncs are already done in cron, and when the cohort is first added or removed from the course. Even adding or removing a user from a cohort ensures that user is promptly [un]enrolled from the courses its in.
Test for this change would be to add a cohort with several hundred users to a course, then to update the course description and hit save. Without the fix, it'll take quite awhile to return while it performs a sync (depending on the cohort size). With the fix, it'll return much faster.
- has been marked as being related by
-
MDL-42206 Don't trigger meta enrolment sync on course settings change
-
- Closed
-