subOHLCs should emit object, not string.

This commit is contained in:
7400
2024-03-17 22:44:35 -07:00
parent e65651ae8a
commit c0aad693e0

View File

@@ -23,8 +23,11 @@ export async function subOHLCs( socket, chainId, poolPeriods) {
for(const key of poolPeriods) {
const room = `${chainId}|${key}`;
socket.join(room)
const ohlc = await ohlcs.get(chainId,key);
let ohlc = await ohlcs.get(chainId,key);
console.log('got ohlc', ohlc)
if (typeof(ohlc)==='string') {
ohlc = JSON.parse(ohlc)
}
socket.emit('ohlc', chainId, key, ohlc)
console.log('joined room', room)
}