subOHLCs should emit object, not string.
This commit is contained in:
5
pool.js
5
pool.js
@@ -23,8 +23,11 @@ export async function subOHLCs( socket, chainId, poolPeriods) {
|
|||||||
for(const key of poolPeriods) {
|
for(const key of poolPeriods) {
|
||||||
const room = `${chainId}|${key}`;
|
const room = `${chainId}|${key}`;
|
||||||
socket.join(room)
|
socket.join(room)
|
||||||
const ohlc = await ohlcs.get(chainId,key);
|
let ohlc = await ohlcs.get(chainId,key);
|
||||||
console.log('got ohlc', ohlc)
|
console.log('got ohlc', ohlc)
|
||||||
|
if (typeof(ohlc)==='string') {
|
||||||
|
ohlc = JSON.parse(ohlc)
|
||||||
|
}
|
||||||
socket.emit('ohlc', chainId, key, ohlc)
|
socket.emit('ohlc', chainId, key, ohlc)
|
||||||
console.log('joined room', room)
|
console.log('joined room', room)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user