ohlc pubsub bugfixes
This commit is contained in:
7
pool.js
7
pool.js
@@ -18,11 +18,14 @@ export function unsubPools( socket, chainId, addresses ) {
|
||||
}
|
||||
|
||||
|
||||
export function subOHLCs( socket, chainId, poolPeriods) {
|
||||
export async function subOHLCs( socket, chainId, poolPeriods) {
|
||||
console.log('subOHLCs', chainId, poolPeriods)
|
||||
for(const key of poolPeriods) {
|
||||
const room = `${chainId}|${key}`;
|
||||
socket.join(room)
|
||||
socket.emit('ohlc', chainId, key, ohlcs[key])
|
||||
const ohlc = await ohlcs.get(chainId,key);
|
||||
console.log('got ohlc', ohlc)
|
||||
socket.emit('ohlc', chainId, key, ohlc)
|
||||
console.log('joined room', room)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user