From 32a7e29499d75e28abb7dc0fcca58ed3f1b45ffa Mon Sep 17 00:00:00 2001 From: Pierre Date: Sat, 1 Nov 2025 23:28:52 +0100 Subject: [PATCH] improved queue --- src/lib/folder-watcher/FolderWatcher.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/folder-watcher/FolderWatcher.ts b/src/lib/folder-watcher/FolderWatcher.ts index 3f68a45..bb32086 100644 --- a/src/lib/folder-watcher/FolderWatcher.ts +++ b/src/lib/folder-watcher/FolderWatcher.ts @@ -97,15 +97,18 @@ export class FolderWatcher { } // Add to queue for concurrency control - // The FileProcessor implementation handles its own internal queue logic + // Queue only controls light processing throughput - hash processing runs independently await this.queue.add(async () => { // Light processing (quick metadata extraction) if (this.fileProcessor.queueFile) { await this.fileProcessor.queueFile(filePath); } - // Heavy processing (hash computation) - await this.fileProcessor.processFile(current, this.queueSize, filePath); + // Heavy processing (hash computation) - fire and forget + // Don't await - let hashQueue handle its own concurrency independently + if (this.fileProcessor.processFile) { + this.fileProcessor.processFile(current, this.queueSize, filePath); + } }); } }