- Fixed the Infinity loop
This commit is contained in:
vorotamoroz committed 2022-10-21 18:20:03 +09:00
1 parent c18b5c24b4
commit d9b69d9a1b
1 file changed
+6 -1
+6 -1
View File
@@ -841,7 +841,8 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
}
}
clearTrigger("applyBatchAuto");
const ret = await runWithLock("procFiles", false, async () => {
const ret = await runWithLock("procFiles", true, async () => {
do {
const procs = [...this.watchedFileEventQueue];
this.watchedFileEventQueue = [];
for (const queue of procs) {
@@ -877,6 +878,8 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
}
}
this.refreshStatusText();
} while (this.watchedFileEventQueue.length != 0);
return true;
})
this.refreshStatusText();
return ret;
@@ -917,8 +920,10 @@ export default class ObsidianLiveSyncPlugin extends Plugin {
}
async applyBatchChange() {
if (this.settings.batchSave) {
return await this.procFileEvent(true);
}
}
// Watch raw events (Internal API)
watchVaultRawEvents(path: string) {