mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2025-12-24 07:01:29 +00:00
- Improved:
- Faster start-up by removing too many logs which indicates normality - By streamlined scanning of customised synchronisation extra phases have been deleted.
This commit is contained in:
@@ -335,7 +335,11 @@ export class ConfigSync extends LiveSyncCommands {
|
|||||||
try {
|
try {
|
||||||
const pluginData = await this.loadPluginData(path);
|
const pluginData = await this.loadPluginData(path);
|
||||||
if (pluginData) {
|
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
|
// Failed to load
|
||||||
return [];
|
return [];
|
||||||
@@ -345,28 +349,10 @@ export class ConfigSync extends LiveSyncCommands {
|
|||||||
Logger(ex, LOG_LEVEL_VERBOSE);
|
Logger(ex, LOG_LEVEL_VERBOSE);
|
||||||
}
|
}
|
||||||
return [];
|
return [];
|
||||||
}, { suspended: false, batchSize: 1, concurrentLimit: 5, delay: 100, yieldThreshold: 10, maintainDelay: false }).pipeTo(
|
}, { suspended: false, batchSize: 1, concurrentLimit: 10, delay: 100, yieldThreshold: 10, maintainDelay: false, totalRemainingReactiveSource: pluginScanningCount }).startPipeline().root.onIdle(() => {
|
||||||
new QueueProcessor(
|
// Logger(`All files enumerated`, LOG_LEVEL_INFO, "get-plugins");
|
||||||
async (pluginDataList) => {
|
this.createMissingConfigurationEntry();
|
||||||
// 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();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
async updatePluginList(showMessage: boolean, updatedDocumentPath?: FilePathWithPrefix): Promise<void> {
|
async updatePluginList(showMessage: boolean, updatedDocumentPath?: FilePathWithPrefix): Promise<void> {
|
||||||
|
|||||||
@@ -2673,7 +2673,7 @@ Or if you are sure know what had been happened, we can unlock the database from
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case EVEN:
|
case EVEN:
|
||||||
Logger("STORAGE == DB :" + file.path + "", LOG_LEVEL_VERBOSE);
|
Logger("STORAGE == DB :" + file.path + "", LOG_LEVEL_DEBUG);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Logger("STORAGE ?? DB :" + file.path + " Something got weird");
|
Logger("STORAGE ?? DB :" + file.path + " Something got weird");
|
||||||
|
|||||||
Reference in New Issue
Block a user