improved queue

This commit is contained in:
Pierre
2025-11-01 23:28:52 +01:00
parent 2843a4e46b
commit 32a7e29499
+6 -3
View File
@@ -97,15 +97,18 @@ export class FolderWatcher {
} }
// Add to queue for concurrency control // 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 () => { await this.queue.add(async () => {
// Light processing (quick metadata extraction) // Light processing (quick metadata extraction)
if (this.fileProcessor.queueFile) { if (this.fileProcessor.queueFile) {
await this.fileProcessor.queueFile(filePath); await this.fileProcessor.queueFile(filePath);
} }
// Heavy processing (hash computation) // Heavy processing (hash computation) - fire and forget
await this.fileProcessor.processFile(current, this.queueSize, filePath); // Don't await - let hashQueue handle its own concurrency independently
if (this.fileProcessor.processFile) {
this.fileProcessor.processFile(current, this.queueSize, filePath);
}
}); });
} }
} }