fix(ci): make crawl backpressure lintable (#452)
This commit is contained in:
parent
b8253fb083
commit
f6ddf654df
@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user