diff --git a/app.js b/app.js index e85e939..65cc6a5 100644 --- a/app.js +++ b/app.js @@ -167,9 +167,14 @@ wsServer.on('connection', socket => { }) socket.on('message', async message => { - socket.send('Loading...') message = JSON.parse(message) + if (message.mode === 'kill') { + console.log('KILLING SOCKET') + await killConsumer(consumers.get(socket)) + consumers.delete(socket) + return + } const currentMode = message.mode === 'realTime' ? realTimeSearch : search console.log('CLUSTERS before run', clusters) console.log('message.cluster', message.cluster)