Eliminate 10-15s pause between package extractions
Release post-process slot immediately after main extraction completes. All slow post-extraction work (nested extraction, auto-rename, archive cleanup, link/sample removal, empty directory cleanup, MKV collection) now runs in background via runDeferredPostExtraction so the next package can start unpacking without delay. - Export hasAnyFilesRecursive, removeEmptyDirectoryTree, cleanupArchives from extractor.ts for use in deferred handler - Import removeDownloadLinkArtifacts, removeSampleArtifacts from cleanup - Expand runDeferredPostExtraction with full post-cleanup pipeline: nested extraction, rename, archive cleanup, link/sample removal, empty dir tree removal, resume state clearing, MKV collection Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
9ddc7d31bb
commit
95cf4fbed8
@@ -1718,7 +1718,7 @@ export function collectArchiveCleanupTargets(sourceArchivePath: string, director
|
||||
return Array.from(targets);
|
||||
}
|
||||
|
||||
async function cleanupArchives(sourceFiles: string[], cleanupMode: CleanupMode): Promise<number> {
|
||||
export async function cleanupArchives(sourceFiles: string[], cleanupMode: CleanupMode): Promise<number> {
|
||||
if (cleanupMode === "none") {
|
||||
return 0;
|
||||
}
|
||||
@@ -1789,7 +1789,7 @@ async function cleanupArchives(sourceFiles: string[], cleanupMode: CleanupMode):
|
||||
return removed;
|
||||
}
|
||||
|
||||
async function hasAnyFilesRecursive(rootDir: string): Promise<boolean> {
|
||||
export async function hasAnyFilesRecursive(rootDir: string): Promise<boolean> {
|
||||
const rootExists = await fs.promises.access(rootDir).then(() => true, () => false);
|
||||
if (!rootExists) {
|
||||
return false;
|
||||
@@ -1837,7 +1837,7 @@ async function hasAnyEntries(rootDir: string): Promise<boolean> {
|
||||
}
|
||||
}
|
||||
|
||||
async function removeEmptyDirectoryTree(rootDir: string): Promise<number> {
|
||||
export async function removeEmptyDirectoryTree(rootDir: string): Promise<number> {
|
||||
const rootExists = await fs.promises.access(rootDir).then(() => true, () => false);
|
||||
if (!rootExists) {
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user