ranges:dates: a point on a connection of its own; --missing still dates every group
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:
1 parent
137e931e9e
commit
33405eb8ca
2 files changed
+41
-23
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user