Skip to content

Commit

Permalink
change stale time to three minutes
Browse files Browse the repository at this point in the history
  • Loading branch information
haileyok committed Dec 18, 2024
1 parent 3481d16 commit 47bce43
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions src/state/queries/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
const SECOND = 1e3
const MINUTE = SECOND * 60
const HOUR = MINUTE * 60

export const STALE = {
SECONDS: {
FIFTEEN: 1e3 * 15,
THIRTY: 1e3 * 30,
FIFTEEN: 15 * SECOND,
THIRTY: 30 * SECOND,
},
MINUTES: {
ONE: 1e3 * 60,
FIVE: 1e3 * 60 * 5,
THIRTY: 1e3 * 60 * 30,
ONE: MINUTE,
THREE: 3 * MINUTE,
FIVE: 5 * MINUTE,
THIRTY: 30 * MINUTE,
},
HOURS: {
ONE: 1e3 * 60 * 60,
ONE: HOUR,
},
INFINITY: Infinity,
}
2 changes: 1 addition & 1 deletion src/state/queries/trending/useTrendingTopics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function useTrendingTopics() {

return useQuery({
refetchOnWindowFocus: true,
staleTime: STALE.MINUTES.THIRTY,
staleTime: STALE.MINUTES.THREE,
queryKey: trendingTopicsQueryKey,
async queryFn() {
const {data} = await agent.api.app.bsky.unspecced.getTrendingTopics({
Expand Down

0 comments on commit 47bce43

Please sign in to comment.