Skip to content

Commit 259dec9

Browse files
committed
perf: reduce data sent in probe sync
1 parent 5b156f3 commit 259dec9

File tree

4 files changed

+557
-45
lines changed

4 files changed

+557
-45
lines changed

Diff for: src/lib/ws/server.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@ let io: WsServer;
2626
let syncedProbeList: SyncedProbeList;
2727

2828
export const initWsServer = async () => {
29-
const pubClient = getRedisClient().duplicate();
30-
const subClient = pubClient.duplicate();
29+
const redis = getRedisClient();
30+
const pubClient = redis.duplicate();
31+
const subClient = redis.duplicate();
3132

3233
await Promise.all([ pubClient.connect(), subClient.connect() ]);
3334

@@ -43,7 +44,7 @@ export const initWsServer = async () => {
4344
dynamicPrivateChannels: true,
4445
}));
4546

46-
syncedProbeList = new SyncedProbeList(io.of(PROBES_NAMESPACE), adoptedProbes);
47+
syncedProbeList = new SyncedProbeList(redis, io.of(PROBES_NAMESPACE), adoptedProbes);
4748

4849
await syncedProbeList.sync();
4950
syncedProbeList.scheduleSync();

0 commit comments

Comments
 (0)