Repository navigation
perf: wake Loom imports from the worker webhook instead of polling - #3120
Merged
Merged
Conversation
Member
Author
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Loom import workflows used to poll the database every 5 to 30 seconds until their media job finished. Each poll is a workflow step plus a replay on Vercel, so a ten minute import cost about 25 invocations, and a batch of 1,200 imports cost tens of thousands.
Now each processing attempt creates a workflow hook whose token goes into the worker's webhook URL. When the worker reports complete, error or cancelled, the progress route saves the state first and then resumes the hook. The workflow then reads the status once. A typical import now uses two status reads instead of dozens.
Safety nets:
Recording, instant and web uploads still use
waitForVideoProcessingand are unchanged.Follows #3118. Replaces #3119, which closed when its base branch was deleted.
Tests: video-processing-status 15, media-server-progress 59, media-processing-workflows 27 pass. The 7 share-stage-identity failures also fail on main.


Confidence Score: 5/5
The PR appears safe to merge; no actionable issues were found.Summary
Loom imports now wait for a worker webhook instead of repeatedly checking the database.
Reviews (2) · Last reviewed commit: "perf: wake Loom import workflows from th..." · Reviewed by Greptile