Final completeness by time window: ranges keep their posting span, release_final() over blocks of done ranges
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
3d24db5565
commit
ce43099188
12 files changed
+259
-9
No files matched your search
@@ -5,6 +5,7 @@ import { Prefetcher } from '#services/prefetcher'
|
||||
import Planner from '#services/planner'
|
||||
import FragmentMerger from '#services/fragment_merger'
|
||||
import Settler from '#services/settler'
|
||||
import RangeBlocks from '#services/range_blocks'
|
||||
import NntpPool from '#services/nntp_pool'
|
||||
import coordinatorConfig from '#config/coordinator'
|
||||
|
||||
@@ -13,6 +14,8 @@ const PLAN_EVERY_MS = 60 * 60 * 1000
|
||||
const MERGE_EVERY_MS = 60 * 1000
|
||||
const MERGE_BUDGET_MS = 30 * 1000
|
||||
const STOP_WAIT_MS = 15 * 1000
|
||||
/** range_blocks (release_final) after ranges finish. */
|
||||
const BLOCKS_EVERY_MS = 5 * 60 * 1000
|
||||
|
||||
/**
|
||||
* The coordinator's background work (REBUILD.md, part 1): the prefetcher,
|
||||
@@ -60,8 +63,13 @@ export default class CoordinatorRun extends BaseCommand {
|
||||
let plannedAt = 0
|
||||
let tailedAt = 0
|
||||
let mergedAt = 0
|
||||
let blocksAt = 0
|
||||
while (!stopping) {
|
||||
try {
|
||||
if (main && Date.now() - blocksAt >= BLOCKS_EVERY_MS) {
|
||||
blocksAt = Date.now()
|
||||
await RangeBlocks.rebuild()
|
||||
}
|
||||
if (main && Date.now() - plannedAt >= PLAN_EVERY_MS) {
|
||||
plannedAt = Date.now()
|
||||
const { groups, ranges } = await Planner.planAll()
|
||||
|
||||
Reference in new issue
Block a user