From 486401444c5d2e9cb35e43be2dd9a80a831a51d0 Mon Sep 17 00:00:00 2001 From: Nour Alharithi Date: Thu, 4 Apr 2024 12:06:07 -0700 Subject: [PATCH] make frequency configurable --- src/publishers/priorityFeesPublisher.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/publishers/priorityFeesPublisher.ts b/src/publishers/priorityFeesPublisher.ts index 5fb53d6..f035f34 100644 --- a/src/publishers/priorityFeesPublisher.ts +++ b/src/publishers/priorityFeesPublisher.ts @@ -41,6 +41,7 @@ const endpoint = token ? process.env.ENDPOINT + `/${token}` : process.env.ENDPOINT; const wsEndpoint = process.env.WS_ENDPOINT; +const FEE_POLLING_FREQUENCY = parseInt(process.env.FEE_POLLING_FREQUENCY) || 5000; if (!endpoint.includes('helius')) { throw new Error('We use helius for fee publisher fellas'); @@ -69,7 +70,7 @@ class PriorityFeeSubscriber { this.perpMarketPubkeys = config.perpMarketPubkeys; this.spotMarketPubkeys = config.spotMarketPubkeys; this.redisClient = config.redisClient; - this.frequencyMs = config.frequencyMs ?? 5000; + this.frequencyMs = config.frequencyMs ?? FEE_POLLING_FREQUENCY; } async subscribe() {