From 84229d3ad1bdf18d38575f2fd51dda2a402b2664 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Fri, 8 Mar 2024 13:21:06 -0800 Subject: [PATCH] stuck slot subscriber causing cahce mis --- src/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 3fa4e52..8e3768e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -275,7 +275,9 @@ const main = async (): Promise => { type: 'websocket', commitment: stateCommitment, }; - slotSubscriber = new SlotSubscriber(connection); + slotSubscriber = new SlotSubscriber(connection, { + resubTimeoutMs: 5000 + }); await slotSubscriber.subscribe(); } @@ -768,7 +770,7 @@ const main = async (): Promise => { const parsedResponse = JSON.parse(redisResponse); if ( parsedResponse && - Math.abs(dlobProvider.getSlot() - parsedResponse.slot) < + dlobProvider.getSlot() - parsedResponse.slot < SLOT_STALENESS_TOLERANCE ) { if (side === 'bid') {