mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-11-03 06:48:18 +00:00
Remove unused ConfigSync scan processor
This commit is contained in:
1 parent
b5e8aa7485
commit
12d3b661fa
2 files changed
-36
No files matched your search
@@ -54,7 +54,6 @@ async function waitForCondition(predicate: () => boolean, message: string) {
|
||||
afterEach(() => {
|
||||
for (const configSync of queueOwners.splice(0)) {
|
||||
configSync.pluginScanProcessor.terminateAll();
|
||||
configSync.pluginScanProcessorV2.terminateAll();
|
||||
}
|
||||
vi.restoreAllMocks();
|
||||
pluginList.set([]);
|
||||
@@ -102,7 +101,6 @@ describe("ConfigSync legacy catalogue queue", () => {
|
||||
expect(configSync.pluginScanProcessor.remaining).toBe(0);
|
||||
} finally {
|
||||
configSync?.pluginScanProcessor.terminateAll();
|
||||
configSync?.pluginScanProcessorV2.terminateAll();
|
||||
await fixture.dispose();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -619,40 +619,6 @@ export class ConfigSync extends LiveSyncCommands {
|
||||
}
|
||||
).startPipeline();
|
||||
|
||||
pluginScanProcessorV2 = new QueueProcessor(
|
||||
async (v: AnyEntry[]) => {
|
||||
const plugin = v[0];
|
||||
const path = plugin.path || this.getPath(plugin);
|
||||
const oldEntry = this.pluginList.find((e) => e.documentPath == path);
|
||||
if (oldEntry && oldEntry.mtime == plugin.mtime) return [];
|
||||
try {
|
||||
const pluginData = await this.loadPluginData(path);
|
||||
if (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 [];
|
||||
} catch (ex) {
|
||||
this._log(`Something happened at enumerating customization :${path}`, LOG_LEVEL_NOTICE);
|
||||
this._log(ex, LOG_LEVEL_VERBOSE);
|
||||
}
|
||||
return [];
|
||||
},
|
||||
{
|
||||
suspended: false,
|
||||
batchSize: 1,
|
||||
concurrentLimit: 10,
|
||||
delay: 100,
|
||||
yieldThreshold: 10,
|
||||
maintainDelay: false,
|
||||
totalRemainingReactiveSource: pluginScanningCount,
|
||||
}
|
||||
).startPipeline();
|
||||
|
||||
filenameToUnifiedKey(path: string, termOverRide?: string) {
|
||||
const term = termOverRide || this.services.setting.getDeviceAndVaultName();
|
||||
const category = this.getFileCategory(path);
|
||||
|
||||
Reference in new issue
Block a user