Skip to content

Commit c7abb23

Browse files
committed
feat: 🎸 early exit syncing when not connected
1 parent bf593ab commit c7abb23

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/json-crdt-repo/local/server-crud/ServerCrudLocalHistorySync.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ export class ServerCrudLocalHistorySync {
182182
const start = Date.now();
183183
return await locks.lock('sync', duration, 3000)(async () => {
184184
for await (const result of this.syncDirty()) {
185+
if (!this.core.connected$.getValue()) return[];
185186
list.push(result);
186187
const now = Date.now();
187188
if (now - start + 100 > duration) break;

0 commit comments

Comments
 (0)