queue improvement
This commit is contained in:
@@ -90,14 +90,15 @@ export class FolderWatcher {
|
|||||||
if (await this.fileProcessor.canProcessFile(filePath)) {
|
if (await this.fileProcessor.canProcessFile(filePath)) {
|
||||||
const current = ++this.current;
|
const current = ++this.current;
|
||||||
|
|
||||||
// Add to queue for concurrency control
|
// Mark as pending BEFORE adding to queue
|
||||||
// The FileProcessor implementation handles its own internal queue logic
|
// This ensures files appear in "pending" state while waiting for queue
|
||||||
await this.queue.add(async () => {
|
|
||||||
// Mark as pending (optional callback)
|
|
||||||
if (this.fileProcessor.markPending) {
|
if (this.fileProcessor.markPending) {
|
||||||
this.fileProcessor.markPending(filePath);
|
this.fileProcessor.markPending(filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add to queue for concurrency control
|
||||||
|
// The FileProcessor implementation handles its own internal queue logic
|
||||||
|
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user