revamp server lite
This commit is contained in:
26
src/index.ts
26
src/index.ts
@@ -682,7 +682,9 @@ const main = async (): Promise<void> => {
|
||||
if (useRedis) {
|
||||
if (!isSpot && `${includeVamm}`?.toLowerCase() === 'true') {
|
||||
const redisClient = perpMarketRedisMap.get(normedMarketIndex).client;
|
||||
const redisL2 = await redisClient.get(`last_update_orderbook_perp_${normedMarketIndex}`);
|
||||
const redisL2 = await redisClient.get(
|
||||
`last_update_orderbook_perp_${normedMarketIndex}`
|
||||
);
|
||||
const depth = Math.min(parseInt(adjustedDepth as string) ?? 1, 100);
|
||||
redisL2['bids'] = redisL2['bids']?.slice(0, depth);
|
||||
redisL2['asks'] = redisL2['asks']?.slice(0, depth);
|
||||
@@ -706,7 +708,9 @@ const main = async (): Promise<void> => {
|
||||
`${includePhoenix}`?.toLowerCase() === 'true'
|
||||
) {
|
||||
const redisClient = spotMarketRedisMap.get(normedMarketIndex).client;
|
||||
const redisL2 = await redisClient.get(`last_update_orderbook_spot_${normedMarketIndex}`);
|
||||
const redisL2 = await redisClient.get(
|
||||
`last_update_orderbook_spot_${normedMarketIndex}`
|
||||
);
|
||||
const depth = Math.min(parseInt(adjustedDepth as string) ?? 1, 100);
|
||||
redisL2['bids'] = redisL2['bids']?.slice(0, depth);
|
||||
redisL2['asks'] = redisL2['asks']?.slice(0, depth);
|
||||
@@ -836,8 +840,13 @@ const main = async (): Promise<void> => {
|
||||
) {
|
||||
const redisClient =
|
||||
perpMarketRedisMap.get(normedMarketIndex).client;
|
||||
const redisL2 = await redisClient.get(`last_update_orderbook_perp_${normedMarketIndex}`);
|
||||
const depth = Math.min(parseInt(adjustedDepth as string) ?? 1, 100);
|
||||
const redisL2 = await redisClient.get(
|
||||
`last_update_orderbook_perp_${normedMarketIndex}`
|
||||
);
|
||||
const depth = Math.min(
|
||||
parseInt(adjustedDepth as string) ?? 1,
|
||||
100
|
||||
);
|
||||
redisL2['bids'] = redisL2['bids']?.slice(0, depth);
|
||||
redisL2['asks'] = redisL2['asks']?.slice(0, depth);
|
||||
if (redisL2) {
|
||||
@@ -861,8 +870,13 @@ const main = async (): Promise<void> => {
|
||||
) {
|
||||
const redisClient =
|
||||
spotMarketRedisMap.get(normedMarketIndex).client;
|
||||
const redisL2 = await redisClient.get(`last_update_orderbook_spot_${normedMarketIndex}`);
|
||||
const depth = Math.min(parseInt(adjustedDepth as string) ?? 1, 100);
|
||||
const redisL2 = await redisClient.get(
|
||||
`last_update_orderbook_spot_${normedMarketIndex}`
|
||||
);
|
||||
const depth = Math.min(
|
||||
parseInt(adjustedDepth as string) ?? 1,
|
||||
100
|
||||
);
|
||||
redisL2['bids'] = redisL2['bids']?.slice(0, depth);
|
||||
redisL2['asks'] = redisL2['asks']?.slice(0, depth);
|
||||
if (redisL2) {
|
||||
|
||||
Reference in New Issue
Block a user