Merge branch 'main' of https://gitlab.com/kafka-dance/kafka-dance-api into main
This commit is contained in:
commit
3f98892ddd
8
app.js
8
app.js
|
@ -169,10 +169,14 @@ wsServer.on('connection', socket => {
|
||||||
})
|
})
|
||||||
|
|
||||||
socket.on('message', async message => {
|
socket.on('message', async message => {
|
||||||
console.log('socket message')
|
|
||||||
//socket.send('Loading...')
|
|
||||||
message = JSON.parse(message)
|
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
|
const currentMode = message.mode === 'realTime' ? realTimeSearch : search
|
||||||
const cluster = clusters[message.cluster]
|
const cluster = clusters[message.cluster]
|
||||||
const run = async () => consumers.set(socket, await currentMode({
|
const run = async () => consumers.set(socket, await currentMode({
|
||||||
|
|
Loading…
Reference in New Issue