Settle every 5 min in rounds of 200k, not ~3M at once hourly; range blocks in a loop of their own
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ce43099188
commit
ec2e5a60be
2 files changed
+28
-9
No files matched your search
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user