Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Issue/718 create worker for scanning #910

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

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
assets/js/Components/App.js Outdated Show resolved Hide resolved
@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
3 participants