Skip to content

Conversation

@taheralfayad
Copy link
Contributor

Fixes #859
Fixes #718

Motive:

The reasoning behind the changes made in this pull request was as follows:

  • UDOIT currently does not show progress updates on the scanning process, and the scanning process sometimes takes upwards of 40 seconds, meaning that users could interpret the behavior as unresponsive and reload the page if the course is too large.

  • Heroku times out a process after 30 seconds of loading, which makes it impossible to scan large courses. As such, the refactoring of the scanning process as a worker process will allow for the scanning of larger courses.

How the scanning process worked:

  • Prior to the changes made in this pull request, the way that a course was scanned was that UDOIT would make a call to the controller at /api/sync/{course} and the controller then would call the refreshLmsContent method at LmsFetchService.php, which would then commence the scanning process. Finally, the controller would send back an updated version of the report.

What changed:

  • Instead of running the scanning process synchronously to the rest of the backend logic. The scanning process is now isolated in a Symfony Message Handler (more commonly known as an asynchronous background worker), and this was done using Symfony Messenger.

@taheralfayad taheralfayad requested a review from dmols July 7, 2023 13:18
@bagofarms
Copy link
Member

Look into using Supervisor to see if it would be more reliable than sleep https://symfony.com/doc/current/messenger.html#supervisor-configuration

@taheralfayad taheralfayad changed the title Issue/718 create worker for scanning WIP: Issue/718 create worker for scanning Apr 15, 2024
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.

Display a updated progress of what's being scanned so user knows something is happening Create worker for scanning

3 participants