Use locks
This commit is contained in:
parent
4fb4b498a1
commit
727b6b7ed5
1 changed files with 247 additions and 319 deletions
|
|
@ -56,7 +56,7 @@ export class SyncClient {
|
|||
database: Partial<StoredDatabase>;
|
||||
}>
|
||||
>
|
||||
) {}
|
||||
) { }
|
||||
|
||||
public get documentCount(): number {
|
||||
return this.database.length;
|
||||
|
|
@ -410,12 +410,8 @@ export class SyncClient {
|
|||
return DocumentSyncStatus.SYNCING;
|
||||
}
|
||||
|
||||
const document =
|
||||
this.database.getLatestDocumentByRelativePath(relativePath);
|
||||
if (document === undefined) {
|
||||
return DocumentSyncStatus.SYNCING;
|
||||
}
|
||||
return document.updates.length > 0
|
||||
|
||||
return this.syncer.hasPendingOperationsForDocument(relativePath)
|
||||
? DocumentSyncStatus.SYNCING
|
||||
: DocumentSyncStatus.UP_TO_DATE;
|
||||
}
|
||||
|
|
@ -495,7 +491,6 @@ export class SyncClient {
|
|||
// don't reset the logger
|
||||
this.cursorTracker.reset();
|
||||
this.syncer.reset();
|
||||
this.unrestrictedSyncer.reset();
|
||||
this.fileOperations.reset();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue