symbol id fixes

This commit is contained in:
Tim
2024-03-13 17:11:48 -04:00
parent 90723ba4ed
commit d7e60ad507
3 changed files with 46 additions and 36 deletions

View File

@@ -16,17 +16,16 @@ export function subOHLC( chainId, pool, period ) {
export function unsubOHLC( chainId, pool, period ) {
for( const [pool,period] of poolPeriods ) {
const key = `${pool}|${period}`
const ckey = `${chainId}|${key}`
if (!(ckey in ohlcSubCounts) || ohlcSubCounts[ckey] === 0) {
console.error('overdecremented ohlc', pool, period)
ohlcSubCounts[ckey] = 1
} else {
ohlcSubCounts[ckey]--
if (ohlcSubCounts[key] === 0)
socket.emit('unsubOHLCs', chainId, [key])
}
const key = `${pool}|${period}`
const ckey = `${chainId}|${key}`
if (!(ckey in ohlcSubCounts) || ohlcSubCounts[ckey] === 0) {
console.error('overdecremented ohlc', pool, period)
ohlcSubCounts[ckey] = 1
} else {
ohlcSubCounts[ckey]--
if (ohlcSubCounts[key] === 0)
// noinspection JSCheckFunctionSignatures
socket.emit('unsubOHLCs', chainId, [key])
}
}