diff --git a/src/ws/handler.js b/src/ws/handler.js index d1ee0fa..6f5a1b7 100644 --- a/src/ws/handler.js +++ b/src/ws/handler.js @@ -50,7 +50,6 @@ const handleMsg = async (msg, id) => { dm = await crud[channel].create(d.data) recvUpdate(channel, dm) fanoutMsg(channel, await crud[channel].getAll()) - fanoutMsg(channel, await crud[channel].getAll()) break; case 'update': dm = await crud[channel].update(d.data.id, d.data.data) @@ -77,10 +76,10 @@ const fanoutMsg = (channel, data) => { data, } connections[k].connection.send(JSON.stringify(d)) - } else if (connections[k].events.indexOf(`streams:full`) !== -1) { + } else if (connections[k].events.indexOf('streams:full') !== -1) { const d = { - event: `streams:full`, - data, + event: 'streams:full', + data: await crud['streams'].getAllPop(), } connections[k].connection.send(JSON.stringify(d)) }