Repository: dusk-network/rusk (language: rust)

Issue:
Increase default refetch interval to 10 seconds
The default refetch interval should be increased to 10 seconds, such that the number of overall requests to node proxies is reduced considerably even if the environment variable for this is not set.


Discussion / hints:

Fix patch:
diff --git a/explorer/README.md b/explorer/README.md
index cfab2bd402..4944bd2328 100644
--- a/explorer/README.md
+++ b/explorer/README.md
@@ -31,7 +31,7 @@ VITE_CHAIN_INFO_ENTRIES=15
 VITE_MARKET_DATA_REFETCH_INTERVAL=120000
 VITE_NODE_URL="" # Optional, set to (e.g. 'https://nodes.dusk.network' to) override default
 VITE_PROVISIONERS_REFETCH_INTERVAL=30000
-VITE_REFETCH_INTERVAL=1000
+VITE_REFETCH_INTERVAL=10000
 VITE_RUSK_PATH="" # Optional, set to '/rusk' for dev mode
 VITE_STATS_REFETCH_INTERVAL=1000
 VITE_TRANSACTIONS_LIST_ENTRIES=100
diff --git a/explorer/src/lib/stores/appStore.js b/explorer/src/lib/stores/appStore.js
index 36f24ad0ca..8430f2e3dd 100644
--- a/explorer/src/lib/stores/appStore.js
+++ b/explorer/src/lib/stores/appStore.js
@@ -9,7 +9,7 @@ const browserDefaults = browser
   : {
       darkMode: false,
     };
-const DEFAULT_FETCH_INTERVAL = 1000;
+const DEFAULT_FETCH_INTERVAL = 10000;
 const DEFAULT_MARKET_FETCH_INTERVAL = 120000;
 const DEFAULT_PROVISIONERS_FETCH_INTERVAL = 30000;
 const DEFAULT_STATS_FETCH_INTERVAL = DEFAULT_FETCH_INTERVAL;
diff --git a/explorer/vite.config.js b/explorer/vite.config.js
index 122fe9d0f7..87bbe102de 100644
--- a/explorer/vite.config.js
+++ b/explorer/vite.config.js
@@ -62,7 +62,7 @@ export default defineConfig(({ mode }) => {
         VITE_MARKET_DATA_REFETCH_INTERVAL: "120000",
         VITE_NODE_URL: "https://nodes.dusk.network",
         VITE_PROVISIONERS_REFETCH_INTERVAL: "30000",
-        VITE_REFETCH_INTERVAL: "1000",
+        VITE_REFETCH_INTERVAL: "10000",
         VITE_RUSK_PATH: "",
         VITE_STATS_REFETCH_INTERVAL: "1000",
         VITE_TRANSACTIONS_LIST_ENTRIES: "100",


Test patch:
diff --git a/explorer/src/lib/stores/__tests__/appStore.spec.js b/explorer/src/lib/stores/__tests__/appStore.spec.js
index 2a598b8caf..5d85311843 100644
--- a/explorer/src/lib/stores/__tests__/appStore.spec.js
+++ b/explorer/src/lib/stores/__tests__/appStore.spec.js
@@ -93,10 +93,10 @@ describe("appStore", () => {
       statsFetchInterval,
     } = get(appStore);
 
-    expect(fetchInterval).toBe(1000);
+    expect(fetchInterval).toBe(10000);
     expect(marketDataFetchInterval).toBe(120000);
     expect(provisionersFetchInterval).toBe(30000);
-    expect(statsFetchInterval).toBe(1000);
+    expect(statsFetchInterval).toBe(10000);
 
     vi.unstubAllEnvs();
   });