Skip to content

Commit

Permalink
Reduce interval time in fetching current realms population
Browse files Browse the repository at this point in the history
  • Loading branch information
xpaczka committed Nov 15, 2023
1 parent 7e4f471 commit 4851cbe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/shared/constants/chains.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable no-console */
import { ethers } from "ethers"
import { SECOND } from "./time"

export const getArbitrumRpcUrl = () => {
if (process.env.USE_LOCALHOST_FORK === "true") {
Expand Down Expand Up @@ -48,7 +49,8 @@ export const TAHO_ADDRESS = CONTRACT_Taho
export const TAHO_SYMBOL = "TAHO"
export const ETH_SYMBOL = "ETH"

export const BALANCE_UPDATE_INTERVAL = 30 * 1000
export const BALANCE_UPDATE_INTERVAL = 30 * SECOND
export const POPULATION_FETCH_INTERVAL = 15 * SECOND

export const CONTRACT_DEPLOYMENT_BLOCK_NUMBER = process.env
.CONTRACT_DEPLOYMENT_BLOCK_NUMBER
Expand Down
3 changes: 2 additions & 1 deletion src/shared/hooks/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
ARBITRUM_SEPOLIA_RPC_FALLBACK,
BALANCE_UPDATE_INTERVAL,
LOCAL_STORAGE_WALLET,
POPULATION_FETCH_INTERVAL,
} from "shared/constants"
import { Network } from "@ethersproject/networks"
import { Logger, defineReadOnly } from "ethers/lib/utils"
Expand Down Expand Up @@ -119,7 +120,7 @@ export function usePopulationFetch() {

useInterval(
populationFetchCallback,
account ? BALANCE_UPDATE_INTERVAL * 2 : null
account ? POPULATION_FETCH_INTERVAL : null
)
}

Expand Down

0 comments on commit 4851cbe

Please sign in to comment.