Inspect fewer files: skip later volumes under random stems
Of 5,000 waiting inspection jobs, 3,212 were queued only because their stem looked random, and 2,044 of those were later RAR volumes (xyz.part47.rar, .r00) or par2 recovery volumes (.vol03+04.par2). Their first segment adds nothing: the set is listed from its first volume and named from its index .par2, as for readable names already. Each one cost a ~700 KB download; inspection pulled ~85 MB/s and fell behind the backfill. - isCandidate() rejects later volumes (isLaterVolume) before the random- name rule. - worker:file only queues files that are candidates, so the ~30% that inspection skips anyway no longer take queue slots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2178847513
commit
95f1d427df
5 files changed
+33
-3
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { test } from '@japa/runner'
|
||||
import yencode from 'yencode'
|
||||
import { sniffContentType } from '#lib/content/index'
|
||||
import { isLaterVolume, sniffContentType } from '#lib/content/index'
|
||||
import { crc32Hex, decodeSegment, YencError } from '#lib/yenc/index'
|
||||
|
||||
test.group('content / sniffContentType', () => {
|
||||
@@ -52,3 +52,14 @@ test.group('yenc / lenientSize', () => {
|
||||
assert.isTrue(decodeSegment(body, { lenientSize: true }).data.equals(data))
|
||||
})
|
||||
})
|
||||
|
||||
test.group('content / isLaterVolume', () => {
|
||||
test('recognises later RAR volumes and par2 recovery volumes, also under a random stem', ({ assert }) => {
|
||||
for (const name of ['P8vttYaPec1mL4nDZHPZo7Nd6iEWj8lP.part47.rar', 'Show.S01E01.part002.rar', 'abc.r00', 'abc.r123', 'x7Kq9.vol03+04.par2', 'Show.vol127-128.par2']) {
|
||||
assert.isTrue(isLaterVolume(name), name)
|
||||
}
|
||||
for (const name of ['P8vttYaPec1mL4nDZHPZo7Nd6iEWj8lP.part01.rar', 'abc.part1.rar', 'abc.rar', 'x7Kq9.par2', '6e13186238ab54ca498e46d2d77da099', 'abc.7z.002', 'abc.mkv']) {
|
||||
assert.isFalse(isLaterVolume(name), name)
|
||||
}
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user