Skip to content

Commit

Permalink
fix queue
Browse files Browse the repository at this point in the history
  • Loading branch information
davwas committed Nov 15, 2023
1 parent 121ee7a commit 628c0af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/server/src/modules/tldraw/service/tldraw.ws.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { readSyncMessage, writeSyncStep1, writeUpdate } from 'y-protocols/sync';
import { TldrawBoardRepo } from '@src/modules/tldraw/repo';
import { Buffer } from 'node:buffer';
import { getDocUpdatesFromQueue, pushDocUpdatesToQueue } from '@src/modules/tldraw/redis';
import { applyUpdate, Doc } from 'yjs';
import { applyUpdate, Doc, encodeStateAsUpdate } from 'yjs';
import { Redis } from 'ioredis';

@Injectable()
Expand Down Expand Up @@ -176,6 +176,8 @@ export class TldrawWsService {
}
});

applyUpdate(doc, encodeStateAsUpdate(redisYDoc));

// Check if connection is still alive
let pongReceived = true;
const pingInterval = setInterval(() => {
Expand Down

0 comments on commit 628c0af

Please sign in to comment.