diff --git a/src/index.ts b/src/index.ts index a6737ea..931aef3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -818,7 +818,9 @@ const main = async () => { client: redisClients[nextClientIndex], clientIndex: nextClientIndex, }); - console.log('Rotated redis client to index ', nextClientIndex); + console.log( + `Rotated redis client to index ${nextClientIndex} for perp market ${normedMarketIndex}` + ); } } } else if ( @@ -858,7 +860,9 @@ const main = async () => { client: redisClients[nextClientIndex], clientIndex: nextClientIndex, }); - console.log('Rotated redis client to index ', nextClientIndex); + console.log( + `Rotated redis client to index ${nextClientIndex} for spot market ${normedMarketIndex}` + ); } } } @@ -1032,8 +1036,7 @@ const main = async () => { clientIndex: nextClientIndex, }); console.log( - 'Rotated redis client to index ', - nextClientIndex + `Rotated redis client to index ${nextClientIndex} for perp market ${normedMarketIndex}` ); } } @@ -1078,8 +1081,7 @@ const main = async () => { clientIndex: nextClientIndex, }); console.log( - 'Rotated redis client to index ', - nextClientIndex + `Rotated redis client to index ${nextClientIndex} for spot market ${normedMarketIndex}` ); } } diff --git a/src/publishers/dlobPublisher.ts b/src/publishers/dlobPublisher.ts index f54e46b..10d9504 100644 --- a/src/publishers/dlobPublisher.ts +++ b/src/publishers/dlobPublisher.ts @@ -324,7 +324,8 @@ const main = async () => { const initAllMarketSubscribersStart = Date.now(); MARKET_SUBSCRIBERS = await initializeAllMarketSubscribers(driftClient); logger.info( - `All market subscribers initialized in ${Date.now() - initAllMarketSubscribersStart + `All market subscribers initialized in ${ + Date.now() - initAllMarketSubscribersStart } ms` ); diff --git a/src/serverLite.ts b/src/serverLite.ts index aeea93d..f607797 100644 --- a/src/serverLite.ts +++ b/src/serverLite.ts @@ -187,7 +187,7 @@ const main = async () => { clientIndex: 0, }); } - + // Slot subscriber for source const connection = new Connection(endpoint, { commitment: stateCommitment, @@ -206,7 +206,7 @@ const main = async () => { ); const handleStartup = async (_req, res, _next) => { - let healthy= false; + let healthy = false; for (const redisClient of redisClients) { if (redisClient.connected) { healthy = true; @@ -291,7 +291,9 @@ const main = async () => { client: redisClients[nextClientIndex], clientIndex: nextClientIndex, }); - console.log('Rotated redis client to index ', nextClientIndex); + console.log( + `Rotated redis client to index ${nextClientIndex} for perp market ${normedMarketIndex}` + ); } } } @@ -331,7 +333,9 @@ const main = async () => { client: redisClients[nextClientIndex], clientIndex: nextClientIndex, }); - console.log('Rotated redis client to index ', nextClientIndex); + console.log( + `Rotated redis client to index ${nextClientIndex} for spot market ${normedMarketIndex}` + ); } } } @@ -424,7 +428,7 @@ const main = async () => { ) { let redisL2: string; const redisClient = - perpMarketRedisMap.get(normedMarketIndex).client; + perpMarketRedisMap.get(normedMarketIndex).client; if (parseInt(adjustedDepth as string) === 5) { redisL2 = await redisClient.client.get( `last_update_orderbook_perp_${normedMarketIndex}_depth_5` @@ -456,8 +460,7 @@ const main = async () => { clientIndex: nextClientIndex, }); console.log( - 'Rotated redis client to index ', - nextClientIndex + `Rotated redis client to index ${nextClientIndex} for perp market ${normedMarketIndex}` ); } } @@ -470,7 +473,7 @@ const main = async () => { ) { let redisL2: string; const redisClient = - spotMarketRedisMap.get(normedMarketIndex).client; + spotMarketRedisMap.get(normedMarketIndex).client; if (parseInt(adjustedDepth as string) === 5) { redisL2 = await redisClient.client.get( `last_update_orderbook_spot_${normedMarketIndex}_depth_5` @@ -502,8 +505,7 @@ const main = async () => { clientIndex: nextClientIndex, }); console.log( - 'Rotated redis client to index ', - nextClientIndex + `Rotated redis client to index ${nextClientIndex} for spot market ${normedMarketIndex}` ); } }