handle streams:full properly

main
Ayush Mukherjee 4 years ago
parent c4c1c86249
commit 8d5bc05cf7

@ -34,6 +34,7 @@ const handleMsg = async (msg, id) => {
data: await crud[channel].getAll(),
}
if (channel === 'streams' && d.subscribe === 'streams:full') {
dm.event = 'streams:full'
dm.data = await crud[channel].getAllPop()
}
connections[id].connection.send(JSON.stringify(dm))
@ -75,6 +76,12 @@ const fanoutMsg = (channel, data) => {
data,
}
connections[k].connection.send(JSON.stringify(d))
} else if (connections[k].events.indexOf(`streams:full`) !== -1) {
const d = {
event: `streams:full`,
data,
}
connections[k].connection.send(JSON.stringify(d))
}
})
}

Loading…
Cancel
Save