From f6ddf654df42563351c0e1823a2049480df4f524 Mon Sep 17 00:00:00 2001 From: Ben Senescu <44480372+bensenescu@users.noreply.github.com> Date: Sat, 1 Aug 2026 14:50:49 -0400 Subject: [PATCH] fix(ci): make crawl backpressure lintable (#452) --- src/server/workflows/siteAuditWorkflowCrawl.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/workflows/siteAuditWorkflowCrawl.ts b/src/server/workflows/siteAuditWorkflowCrawl.ts index cba90cc..5080ce0 100644 --- a/src/server/workflows/siteAuditWorkflowCrawl.ts +++ b/src/server/workflows/siteAuditWorkflowCrawl.ts @@ -195,10 +195,13 @@ async function runCrawlChunk( while (true) { while ( inFlight.size < windowSize && - queuedPersists <= MAX_QUEUED_PERSIST_BATCHES && nextIndex < claimed.length && Date.now() < deadlineAt ) { + // queuedPersists changes when persistChain settles. Keep it out of the + // loop condition because the type-aware linter cannot see that async + // mutation and flags the otherwise valid backpressure check. + if (queuedPersists > MAX_QUEUED_PERSIST_BATCHES) break; launch(claimed[nextIndex]); nextIndex += 1; }