ranges:dates: a point on a connection of its own; --missing still dates every group
Test and deploy / test (push) Successful in 54s
Test and deploy / edge (push) Successful in 2m4s
Test and deploy / deploy (push) Successful in 1m53s

Sixteen groups never got through on one connection (a reply timed out
after 2 minutes); now a timed-out point is skipped and logged, the
group goes on, and stops after 3 failures. estimate() ignored --missing's
filter: it dated 0 groups on the second run.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
Daan MeijerandClaude Fable 5.1 committed 2026-10-25 10:31:35 +01:00
1 parent 137e931e9e
commit 33405eb8ca
2 files changed
+41 -23

No files matched your search

+8 -6
View File
@@ -48,10 +48,10 @@ export default class RangesDates extends BaseCommand {
}
}
private groups() {
private groups(missing = this.missing) {
const q = db.from('groups').where('active', true).select('id', 'name').orderBy('priority')
if (this.group) q.where('name', 'like', this.group)
if (this.missing)
if (missing)
q.whereNotExists((sub) =>
sub.from('group_dates').whereRaw('group_dates.group_id = groups.id')
)
@@ -85,9 +85,11 @@ export default class RangesDates extends BaseCommand {
const worker = async () => {
for (let g = queue.shift(); g; g = queue.shift()) {
try {
const result = await NntpPool.use((client) =>
sampleGroup(client, g.name, { every, size: 32 })
)
const result = await sampleGroup((work) => NntpPool.use(work), g.name, {
every,
size: 32,
})
for (const f of result.failed) this.logger.warning(`${g.name} at ${f}`)
await db.transaction(async (trx) => {
await trx.from('group_dates').where('group_id', g.id).delete()
if (result.samples.length > 0)
@@ -129,7 +131,7 @@ export default class RangesDates extends BaseCommand {
/** Every range of the groups sampled gets est_date from the group's curve (1000 a statement). */
private async estimate() {
const groups = await this.groups().whereExists((sub) =>
const groups = await this.groups(false).whereExists((sub) =>
sub.from('group_dates').whereRaw('group_dates.group_id = groups.id')
)
let updated = 0