Skip to content

Commit

Permalink
- Improved:
Browse files Browse the repository at this point in the history
  - Faster start-up by removing too many logs which indicates normality
  - By streamlined scanning of customised synchronisation extra phases have been deleted.
  • Loading branch information
vrtmrz committed Mar 22, 2024
1 parent e76e7ae commit f91109b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 24 deletions.
32 changes: 9 additions & 23 deletions src/CmdConfigSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 [];
Expand All @@ -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<void> {
Expand Down
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit f91109b

Please sign in to comment.