Repository navigation
Serialize Wattsi requests and add timeout - #217
Merged
Merged
Conversation
The Wattsi server doesn't appear to cope with concurrent builds, but several whatwg/html PRs can be processed at once, each posting to it. Queue every fetchZip call in the process behind the previous one, so the server only ever sees one request, and give requests a 10-minute timeout so a stalled one can't hold up the queue forever. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014Wpzz6o6jpVTWPb22dXBBT
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.
Summary
This change ensures that Wattsi requests are processed sequentially across all PRs being handled by the process, and adds a timeout to prevent requests from stalling indefinitely.
Key Changes
wattsiQueuethat serializes allfetchZipcalls across different PR instances using aoneAtATimewrapper functionWATTSI_TIMEOUTconstant (10 minutes) to the POST request to prevent indefinite hangsfetch()method to wrap bothfetchZipcalls withoneAtATime()Implementation Details
oneAtATimefunction chains promises sequentially:wattsiQueue.then(fn, fn)ensures the function runs regardless of whether the previous promise resolved or rejectedwattsiQueue = run.catch(() => {})swallows errors so they don't propagate to the next queued requesthttps://claude.ai/code/session_014Wpzz6o6jpVTWPb22dXBBT