Wait for idle instead

This commit is contained in:
Andras Schmelczer 2025-12-14 11:06:49 +00:00
parent b6ab01d56a
commit 47f24e168b

View file

@ -171,7 +171,7 @@ export class Syncer {
// in that case, we mustn't move it again. // in that case, we mustn't move it again.
if ( if (
this.database.getLatestDocumentByRelativePath(relativePath) === this.database.getLatestDocumentByRelativePath(relativePath) ===
undefined || undefined ||
this.database.getLatestDocumentByRelativePath(relativePath) this.database.getLatestDocumentByRelativePath(relativePath)
?.isDeleted === true ?.isDeleted === true
) { ) {
@ -264,7 +264,7 @@ export class Syncer {
public async waitUntilFinished(): Promise<void> { public async waitUntilFinished(): Promise<void> {
await this.runningScheduleSyncForOfflineChanges; await this.runningScheduleSyncForOfflineChanges;
await this.syncQueue.onEmpty(); await this.syncQueue.onIdle(); // Wait for queue to be empty and running tasks to finish
} }
public async syncRemotelyUpdatedFile( public async syncRemotelyUpdatedFile(