diff --git a/src/CmdConfigSync.ts b/src/CmdConfigSync.ts index 6f9360d..c7c8e6d 100644 --- a/src/CmdConfigSync.ts +++ b/src/CmdConfigSync.ts @@ -335,7 +335,11 @@ export class ConfigSync extends LiveSyncCommands { try { const pluginData = await this.loadPluginData(path); if (pluginData) { - return [pluginData]; + let newList = [...this.pluginList]; + newList = newList.filter(x => x.documentPath != pluginData.documentPath); + newList.push(pluginData); + this.pluginList = newList; + pluginList.set(newList); } // Failed to load return []; @@ -345,28 +349,10 @@ export class ConfigSync extends LiveSyncCommands { Logger(ex, LOG_LEVEL_VERBOSE); } return []; - }, { suspended: false, batchSize: 1, concurrentLimit: 5, delay: 100, yieldThreshold: 10, maintainDelay: false }).pipeTo( - new QueueProcessor( - async (pluginDataList) => { - // Concurrency is two, therefore, we can unlock the previous awaiting. - sendSignal("plugin-next-load"); - let newList = [...this.pluginList]; - for (const item of pluginDataList) { - newList = newList.filter(x => x.documentPath != item.documentPath); - newList.push(item) - } - this.pluginList = newList; - pluginList.set(newList); - if (pluginDataList.length != 10) { - // If the queue is going to be empty, await subsequent for a while. - await waitForSignal("plugin-next-load", 1000); - } - return; - } - , { suspended: false, batchSize: 10, concurrentLimit: 2, delay: 100, yieldThreshold: 25, totalRemainingReactiveSource: pluginScanningCount, maintainDelay: false })).startPipeline().root.onIdle(() => { - // Logger(`All files enumerated`, LOG_LEVEL_INFO, "get-plugins"); - this.createMissingConfigurationEntry(); - }); + }, { suspended: false, batchSize: 1, concurrentLimit: 10, delay: 100, yieldThreshold: 10, maintainDelay: false, totalRemainingReactiveSource: pluginScanningCount }).startPipeline().root.onIdle(() => { + // Logger(`All files enumerated`, LOG_LEVEL_INFO, "get-plugins"); + this.createMissingConfigurationEntry(); + }); async updatePluginList(showMessage: boolean, updatedDocumentPath?: FilePathWithPrefix): Promise { diff --git a/src/main.ts b/src/main.ts index 6e043f4..c2357db 100644 --- a/src/main.ts +++ b/src/main.ts @@ -2673,7 +2673,7 @@ Or if you are sure know what had been happened, we can unlock the database from } break; case EVEN: - Logger("STORAGE == DB :" + file.path + "", LOG_LEVEL_VERBOSE); + Logger("STORAGE == DB :" + file.path + "", LOG_LEVEL_DEBUG); break; default: Logger("STORAGE ?? DB :" + file.path + " Something got weird");