Skip to content

Convert calsync observers to async adhoc tasks#3220

Open
patmr7 wants to merge 1 commit into
MOODLE_405_STABLEfrom
wip-130498-m405
Open

Convert calsync observers to async adhoc tasks#3220
patmr7 wants to merge 1 commit into
MOODLE_405_STABLEfrom
wip-130498-m405

Conversation

@patmr7

@patmr7 patmr7 commented Jun 5, 2026

Copy link
Copy Markdown
Collaborator

Synchronous Graph API calls in calendar event observers blocked web requests for minutes in courses with large enrolments. Replace direct sync calls with a new synccalendarevent adhoc task queued by each observer instead.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR moves Microsoft Outlook calendar synchronization triggered by Moodle calendar event observers from synchronous Graph API calls (during web requests) to asynchronous processing via a new ad-hoc task, preventing long request blocking in large-enrolment courses.

Changes:

  • Added a new ad-hoc task (synccalendarevent) to perform per-event create/update/delete sync work in cron.
  • Updated calendar event observers to queue the ad-hoc task instead of calling Graph sync methods inline.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
local/o365/classes/feature/calsync/task/synccalendarevent.php Introduces a new ad-hoc task to perform per-event Outlook sync actions asynchronously.
local/o365/classes/feature/calsync/observers.php Switches calendar event observers to queue the new ad-hoc task rather than running sync during the request.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread local/o365/classes/feature/calsync/task/synccalendarevent.php
Comment thread local/o365/classes/feature/calsync/task/synccalendarevent.php
Synchronous Graph API calls in calendar event observers blocked web requests for minutes in courses with large enrolments. Replace direct sync calls with a new synccalendarevent adhoc task queued by each observer instead.
@patmr7 patmr7 force-pushed the wip-130498-m405 branch from e2c54d7 to 9b98d8b Compare June 12, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants