fix(sitemap): remove getProvider() fan-out — pre-filter slugs in worker - #2155
Merged
Conversation
This was referenced Aug 27, 2026
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.
Problem
After the slim-blob sitemap shipped,
buildFullSitemap()calledgetProvider(slug)505 times in parallel to validate provider slugs. Each call internally triggersloadAggregateFromBlob()which cannot be cached (>2MBunstable_cachelimit), so each of the 505 calls fetched the 4.25MB blob independently — OOM crash in ~65s, bypassing both the 75s JS timeout and the route handler try/catch.Fix
Worker (
publish-aggregate.ts): pre-filterproviderSlugsat publish time to exclude chain slugs, HL builder slugs, perp venue slugs (except polymarket), and removed slugs. These are O(1) set lookups using shared constants.Vercel (
sitemap-builder.ts): replace thePromise.all(getProvider())async fan-out with a sync.filter()using the same set checks (safety net). Remove the deadgetProviderimport.COMPARE_PAIRSroutes are also emitted directly (curated list, no validation needed).Result:
buildFullSitemap()makes zero async provider calls — fetches only the 50KB slim blob + answers + alternatives (~15ms total).