Skip to content

Commit

Permalink
refactor: use seconds for cache time in toptokenholder state
Browse files Browse the repository at this point in the history
  • Loading branch information
yvesfracari committed Oct 22, 2024
1 parent 5cb5b72 commit 22501d4
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ export const topTokenHoldersAtom = atom(
async (get, set, params: GetTopTokenHoldersParams) => {
const key = `${params.chainId}:${params.tokenAddress?.toLowerCase()}`
const cachedData = get(baseTopTokenHolderAtom)
const currentTime = Date.now()
const currentTime = Date.now() / 1000

// 1 hour in milliseconds
if (cachedData[key] && currentTime - cachedData[key].timestamp <= 3600000) {
// 1 hour in seconds
if (cachedData[key] && currentTime - cachedData[key].timestamp <= 3600) {
return cachedData[key].value
}

Expand Down

0 comments on commit 22501d4

Please sign in to comment.