MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / sendCount

Function sendCount

apps/api/src/controllers/live.controller.ts:30–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28 guardSocket(socket, req);
29 const { params } = req;
30 const sendCount = () => {
31 eventBuffer
32 .getActiveVisitorCount(params.projectId)
33 .then((count) => {
34 socket.send(String(count));
35 })
36 .catch(() => {
37 socket.send('0');
38 });
39 };
40
41 const unsubscribe = subscribeToPublishedEvent(
42 'events',

Callers 1

wsVisitorsFunction · 0.85

Calls 4

getActiveVisitorCountMethod · 0.80
catchMethod · 0.45
thenMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected