Rebuild: the live tail
coordinator:run plans the articles after each group's last range every
TAIL_EVERY_SECONDS (120): one LIST ACTIVE per name prefix gives every
group's newest article, and new articles become ranges at priority -1,
leased and prefetched before any history. A group gets a tail range once
it has TAIL_MIN_ARTICLES (100k, a chunk) new or its last planning is
TAIL_MAX_DELAY_MINUTES (15) ago, so quiet groups don't make a range every
round. History (planAll, hourly) is now only for groups not planned yet.
ranges:plan --tail plans one round.
Found on the way: with XFEATURE COMPRESS GZIP on, Eweka compresses LIST
ACTIVE's reply too ("215 NewsGroups Follow [COMPRESS=GZIP]"), and
listActive waited for a plain end that never came (groups:add --top too).
It reads the compressed reply now; the fake server in the test does both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
df89045f98
commit
fd0f2bde75
8 files changed
+166
-7
No files matched your search
@@ -39,6 +39,16 @@ function server(): Promise<{ port: number; close: () => void }> {
|
||||
sock.write('224 Overview Information Follows\r\n')
|
||||
send(Buffer.concat([body, Buffer.from('.\r\n')]))
|
||||
}
|
||||
} else if (line.startsWith('LIST ACTIVE')) {
|
||||
// As Eweka: compressed too once XFEATURE COMPRESS GZIP is on.
|
||||
const body = Buffer.from('a.b.test 102 101 y\r\na.b.other 9000000000 2 y\r\n')
|
||||
if (gzip) {
|
||||
sock.write('215 NewsGroups Follow [COMPRESS=GZIP]\r\n')
|
||||
send(Buffer.concat([deflateSync(body), Buffer.from('.\r\n')]))
|
||||
} else {
|
||||
sock.write('215 NewsGroups Follow\r\n')
|
||||
send(Buffer.concat([body, Buffer.from('.\r\n')]))
|
||||
}
|
||||
} else if (line === 'QUIT') sock.end('205 bye\r\n')
|
||||
}
|
||||
})
|
||||
@@ -68,6 +78,10 @@ test.group('nntp / XoverClient', () => {
|
||||
assert.equal(overviews[1][1].subject, 'Show.S01E01 - "a.mkv" yEnc (2/2)')
|
||||
assert.deepEqual(await client.xover(1, 1), [])
|
||||
assert.lengthOf(await client.xover(101, 102), 2)
|
||||
assert.deepEqual(await client.listActive('a.b.*'), [
|
||||
{ name: 'a.b.test', high: 102, low: 101 },
|
||||
{ name: 'a.b.other', high: 9_000_000_000, low: 2 },
|
||||
])
|
||||
} finally {
|
||||
client.close()
|
||||
close()
|
||||
|
||||
Reference in new issue
Block a user