Skip to content

Conversation

@emanuelGitCodes
Copy link

✨ Pull Request: Asynchronous Scanning Pipeline & Issue-Persistence Overhaul


“From our very first Supervisor queue to a fully-parallel rescan workflow.”


📋 Summary


This PR rolls up every change made since we introduced Symfony Messenger workers and Supervisor—culminating in a brand-new, end-to-end pipeline that refreshes LMS data, scans content items in parallel, and reliably persists Equal Access issues.


🗺️ Architecture at a Glance

Layer New Components Notes
Messaging ScanContentItem, FullRescanMessage, FinishRescanMessage Clear unit-of-work messages; supports batching.
Handlers FullRescanHandler, ScanContentItemHandler, FinishRescanHandler Orchestrate refresh → scan → aggregate.
Services LocalApiAccessibilityService, major updates to LmsFetchService, EqualAccessService, CanvasLms, ScannerService Async HTTP, rate-limit back-off, generic-issue path, report math, etc.
Entities / DB New Issue creation paths (createIssue, createGenericIssue) Handles both PhpAllyIssue and generic Equal Access DTOs.


✅ How to Test

  1. Full Rescan → queue FullRescanMessage; observe workers process items in parallel and FinishRescanHandler mark scan ✔️.

  2. Database → verify issue rows populate for each content item.

  3. Canvas API Throttle → throttle Canvas to 1 req/sec; worker should self-sleep without 429s.


📝 Deployment Notes

# supervisorctl 
supervisorctl status

# New ENV
SCAN_POOL_SIZE=6

emanuelGitCodes and others added 30 commits February 4, 2025 08:23
Removed the disabled locks on the menu tabs to allow user to click to report once scan started.
API now calls the aysnc refresh function instead of normal.
Adds aysnc function which removes steps and calls correct function to start async scanning
- Gets course content asynchronously and then triggers scan as content is finished downloading

Co-authored-by: Emanuel <emanuelcodes@gmail.com>
In the update course content in CanvasLMS it previously was creating new item, but also updating it later in code.
Durning creation added the rest of the fields needed to avoid duplicate assignments.
Adds local scanner support and adds more print statements to test output
Adds to gitignore the scanner files that are downloaded from another repo.
Removes usage of AuthToken in functions and passing it through etc.
…ng. This files are not complete, there more like blueprints to what to do.
Co-authored-by: Emanuel <emanuelcodes@gmail.com>
Adds messenger system to queue scans.
Currently queues print statement.
Messenger system starts workers and runs concurrently.
Fixes issue with logging not appearing by routing log output to normal stdout and stderr
Updates the messenger to scan the content item.
Adds wait code to wait until all the message workers have completed before finishing the report.
Adds delete function to the MessageHandler instead.
Adds new separatate async function to be called by the message to avoid editing current one.
Updates config and adds more detaches and flushes to try and fix database saving
Re-adds routing back to the async there.
Removes random return in the async refresh.
Removed equal access server to help future merges.
Uncommeted the ace container since removed the files for it.
…to dispatch full rescan jobs async.

Force Full Rescan works and scans everything, but it runs twice. First runs scans everything, second is redundant.
…ontent scanning

- Consolidate messenger worker configurations into a single directory.
- Introduce new messenger handlers for concurrent and high-priority content scanning.
- Update `ScanContentItem` to include content item ID and user ID.
- Modify `FullRescanHandler` to dispatch `ScanContentItem` messages for updated items.
- Adjust `LmsFetchService` to return updated content items for processing.

Working towards having the `Force Full Rescan` process to be divided between different workers to make it faster.
…umber of browsers available on the local scanner.
…sing; mark items as pending and dispatch FinishRescanMessage when all items are processed.
…redis

Have to confirm all issues are being downloaded
…tent item count, and improve ScanContentItemHandler to persist issues. Update LocalApiAccessibilityService and ScannerService for better data handling.
@emanuelGitCodes emanuelGitCodes added enhancement php Pull requests that update Php code review labels Jun 19, 2025
@emanuelGitCodes
Copy link
Author

Updated the new env variables to

###> Equal Access Local Num Browsers ###
###> One thread per browser instance, so this is the number of browsers to run in parallel.
ASYNC_POOL_SIZE=2

##> Threads focus on the start and end of the scan, so this is the number of scans to run in parallel.
ASYNC_HIGH_PRIORITY_POOL_SIZE=2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement php Pull requests that update Php code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants