()
| 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', |
no test coverage detected