- groups:add / ranges:plan / nodes:create / coordinator:run commands - the node API: lease, the range's chunks as one framed stream from the spool, batches, heartbeat, finish, release (node guard, token per node) - edge:node: needs COORDINATOR_URL and NODE_TOKEN only (placeholders for the rest), posts a batch every 10 chunks, gives its range back on SIGTERM - releases are gathered per batch: 1.04 chunk rows per release at 10 chunks per batch (1.35 when built per XOVER chunk) - partitions are checked per batch instead of remembered Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
21 lines
706 B
TypeScript
21 lines
706 B
TypeScript
import { BaseCommand } from '@adonisjs/core/ace'
|
|
import type { CommandOptions } from '@adonisjs/core/types/ace'
|
|
import Planner from '#services/planner'
|
|
import NntpPool from '#services/nntp_pool'
|
|
|
|
/** Cuts every active group's history (and new articles since) into ranges. */
|
|
export default class RangesPlan extends BaseCommand {
|
|
static commandName = 'ranges:plan'
|
|
static description = "Plans ranges for the indexed groups' articles"
|
|
static options: CommandOptions = { startApp: true }
|
|
|
|
async run() {
|
|
try {
|
|
const { groups, ranges } = await Planner.planAll()
|
|
this.logger.info(`${ranges} ranges planned over ${groups} groups.`)
|
|
} finally {
|
|
await NntpPool.close()
|
|
}
|
|
}
|
|
}
|