fix(ci): make crawl backpressure lintable (#452)

This commit is contained in:
Ben Senescu 2026-08-01 14:50:49 -04:00 committed by GitHub
parent b8253fb083
commit f6ddf654df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -195,10 +195,13 @@ async function runCrawlChunk(
while (true) { while (true) {
while ( while (
inFlight.size < windowSize && inFlight.size < windowSize &&
queuedPersists <= MAX_QUEUED_PERSIST_BATCHES &&
nextIndex < claimed.length && nextIndex < claimed.length &&
Date.now() < deadlineAt 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]); launch(claimed[nextIndex]);
nextIndex += 1; nextIndex += 1;
} }