undefined guard and remove resubscribe for drift client

This commit is contained in:
Nour Alharithi
2023-12-15 13:06:44 -08:00
parent 1e9e3caccc
commit a8fd22d1dd
2 changed files with 11 additions and 11 deletions

View File

@@ -60,7 +60,8 @@ const useOrderSubscriber =
const useGrpc = process.env.USE_GRPC?.toLowerCase() === 'true';
const useWebsocket = process.env.USE_WEBSOCKET?.toLowerCase() === 'true';
const ORDERBOOK_UPDATE_INTERVAL = 1000;
const ORDERBOOK_UPDATE_INTERVAL =
parseInt(process.env.ORDERBOOK_UPDATE_INTERVAL) || 1000;
const WS_FALLBACK_FETCH_INTERVAL = 10_000;
logger.info(`RPC endpoint: ${endpoint}`);
@@ -166,7 +167,6 @@ const main = async () => {
accountSubscription = {
type: 'websocket',
commitment: stateCommitment,
resubTimeoutMs: 30_000,
};
slotSubscriber = new SlotSubscriber(connection);
await slotSubscriber.subscribe();