Rebuild: merger rounds with one neighbour query, a cursor and a time budget; planning skips failing groups
The neighbour check was three queries per file (~2,000 files/minute); now one per round of 20k files, with a cursor so waiting files don't take every round's places, and rounds until nothing is left or 30 s. On the dev backlog (old-style fragments): ~18k files/minute in the 30 s budget; at full throughput the new fragment rule leaves ~1,200 files/minute. A group that fails GROUP (gone from the server) no longer stops planning the others; edge:bench's groups are inactive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b862201991
commit
31493a98be
4 files changed
+66
-22
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import db from '@adonisjs/lucid/services/db'
|
||||
import logger from '@adonisjs/core/services/logger'
|
||||
import coordinatorConfig from '#config/coordinator'
|
||||
import NntpPool from '#services/nntp_pool'
|
||||
|
||||
@@ -56,7 +57,14 @@ class Planner {
|
||||
async planAll(): Promise<{ groups: number; ranges: number }> {
|
||||
const groups = await db.from('groups').where('active', true).orderBy('priority').select('id', 'name')
|
||||
let ranges = 0
|
||||
for (const group of groups) ranges += await this.planGroup({ id: Number(group.id), name: group.name })
|
||||
for (const group of groups) {
|
||||
// One group failing (e.g. gone from the server) doesn't stop the others.
|
||||
try {
|
||||
ranges += await this.planGroup({ id: Number(group.id), name: group.name })
|
||||
} catch (error: any) {
|
||||
logger.warn(`Planning ${group.name}: ${error.message}`)
|
||||
}
|
||||
}
|
||||
return { groups: groups.length, ranges }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user