add back returning after cache hit
This commit is contained in:
@@ -650,7 +650,8 @@ const main = async (): Promise<void> => {
|
||||
const depth = Math.min(parseInt(adjustedDepth as string) ?? 1, 100);
|
||||
redisL2['bids'] = redisL2['bids']?.slice(0, depth);
|
||||
redisL2['asks'] = redisL2['asks']?.slice(0, depth);
|
||||
|
||||
console.log(redisL2['slot']);
|
||||
console.log(SLOT_STALENESS_TOLERANCE);
|
||||
if (
|
||||
redisL2 &&
|
||||
dlobProvider.getSlot() - redisL2['slot'] < SLOT_STALENESS_TOLERANCE
|
||||
@@ -675,6 +676,7 @@ const main = async (): Promise<void> => {
|
||||
) {
|
||||
l2Formatted = JSON.stringify(redisL2);
|
||||
}
|
||||
}
|
||||
|
||||
if (l2Formatted) {
|
||||
cacheHitCounter.add(1, {
|
||||
@@ -685,7 +687,6 @@ const main = async (): Promise<void> => {
|
||||
res.end(l2Formatted);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
let validateIncludeVamm = false;
|
||||
if (!isSpot && `${includeVamm}`.toLowerCase() === 'true') {
|
||||
@@ -824,6 +825,7 @@ const main = async (): Promise<void> => {
|
||||
l2Formatted = redisL2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (l2Formatted) {
|
||||
cacheHitCounter.add(1, {
|
||||
@@ -832,7 +834,6 @@ const main = async (): Promise<void> => {
|
||||
});
|
||||
return l2Formatted;
|
||||
}
|
||||
}
|
||||
|
||||
let validateIncludeVamm = false;
|
||||
if (!isSpot && `${includeVamm}`.toLowerCase() === 'true') {
|
||||
|
||||
Reference in New Issue
Block a user