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
@@ -8,6 +8,7 @@ import { decodeSegment, YencCrcError, YencError, YencFile } from '#lib/yenc/inde
|
||||
import NzbImportService, { type NzbImportResult } from '#services/NzbImportService'
|
||||
import {
|
||||
isArchiveStart,
|
||||
isLaterVolume,
|
||||
NICOVIDEO_FILE,
|
||||
NICOVIDEO_RELEASE,
|
||||
nicovideoInfo,
|
||||
@@ -68,6 +69,8 @@ export interface ContentResult {
|
||||
class ContentService {
|
||||
/** Random or missing names, and named first RAR volumes (for contents and password flag). */
|
||||
isCandidate(name: string) {
|
||||
// Even under a random stem: the first volume and the index .par2 are inspected instead.
|
||||
if (isLaterVolume(name)) return false
|
||||
if (!looksLikeFilename(name) || looksRandom(fileStem(name))) return true
|
||||
if (isArchiveStart(name)) return true
|
||||
if (/\.nzb$/i.test(name)) return true
|
||||
|
||||
Reference in new issue
Block a user