o365-moodle icon indicating copy to clipboard operation
o365-moodle copied to clipboard

Make use of ad-hoc tasks for the chunking of the sync process

Open aspark21 opened this issue 3 years ago • 2 comments

Currently the sync will do the following ...... 510001 users received. Syncing... ...... 10000 users in chunk. Syncing...

These chunks are pretty meaningless as all users are still being processed within the same running task. You should generate ad-hoc tasks to process each of those 10000 users chunks. It would also allow the Moodle system to process more users and make use of the scaling parallelism capabilities ad-hoc tasks provide so a full sync could take a fraction of the time - would help with #2146

aspark21 avatar Aug 30 '22 10:08 aspark21

https://moodledev.io/docs/apis/subsystems/task/adhoc#creating-adhoc-tasks

aspark21 avatar Aug 30 '22 10:08 aspark21

Hi @aspark21,

Thank you for reporting this.

Over 510K users? That's a record!! I agree if there are indeed that many users, processing them in scheduled tasks is inappropriate. It may even be a problem for the initial sync when using delta sync. In that case ad-hoc task would be the preferable solution.

I'll mark this a feature request and process it accordingly.

Regards, Lai

weilai-irl avatar Aug 30 '22 10:08 weilai-irl