Settle every 5 min in rounds of 200k, not ~3M at once hourly; range blocks in a loop of their own
Test and deploy / test (push) Successful in 1m0s
Test and deploy / edge (push) Successful in 2m1s
Test and deploy / deploy (push) Successful in 3m48s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Daan MeijerandClaude Opus 5.5 committed 2026-10-16 14:56:27 +02:00
1 parent ce43099188
commit ec2e5a60be
2 files changed
+28 -9

No files matched your search

+4 -2
View File
@@ -18,9 +18,10 @@ const BATCH = 50_000
* reads par2 sets for those). Phase 2 picks its work from settled releases.
*/
class Settler {
async run(): Promise<number> {
/** Up to `batches` batches of BATCH (all there are without). */
async run(batches = Infinity): Promise<number> {
let settled = 0
while (true) {
for (let batch = 0; batch < batches; batch++) {
// Their probe candidates become claimable (Prober.claim), the unreadable ones first.
const { rows } = await db.rawQuery(
`WITH settled AS (
@@ -39,6 +40,7 @@ class Settler {
settled += n
if (n < BATCH) return settled
}
return settled
}
}