import env from '#start/env' import app from '@adonisjs/core/services/app' /** The coordinator (REBUILD.md, part 1). */ export default { /** Articles per range. */ rangeArticles: env.get('RANGE_ARTICLES', 2_000_000), /** * Articles per XOVER chunk (spool files, stream frames). Eweka takes * ~1.5–2 s per command whatever its size: one connection read 9–15k * lines/s in chunks of 25k, ~20k in 50k, ~30k in 100k and 200k (LOG.md * 2026-10-09). */ chunkArticles: env.get('CHUNK_ARTICLES', 100_000), /** * The live tail (REBUILD.md, coordinator): new articles become ranges * every `everySeconds` (one LIST ACTIVE per name prefix), leased and * fetched before any history. A group gets a tail range once it has * `minArticles` new (a chunk) or its oldest unplanned article waited * `maxDelayMinutes`, so a quiet group doesn't make a range every round. */ tail: { everySeconds: env.get('TAIL_EVERY_SECONDS', 120), minArticles: env.get('TAIL_MIN_ARTICLES', 100_000), maxDelayMinutes: env.get('TAIL_MAX_DELAY_MINUTES', 15), /** Before the history's 0 (oldest) … 1000 (newest). */ priority: -1, }, /** A leased range without a heartbeat for this long goes back to the queue. */ leaseTtlSeconds: env.get('LEASE_TTL_SECONDS', 15 * 60), /** NNTP connections the coordinator fetches headers with. */ nntpConnections: env.get('NNTP_CONNECTIONS', 4), /** A reply with no data for this long fails (old ranges answer slowly). */ nntpTimeoutMs: env.get('NNTP_TIMEOUT_MS', 10 * 60 * 1000), spool: { dir: env.get('SPOOL_DIR', app.tmpPath('spool')), /** Ranges kept fetched ahead, per active lease. */ aheadPerLease: env.get('SPOOL_AHEAD_PER_LEASE', 2), /** At least this many ranges ahead, so the first leases start at once. */ minAhead: env.get('SPOOL_MIN_AHEAD', 2), maxBytes: env.get('SPOOL_MAX_GB', 10) * 1e9, }, }