Stale time to 30m

This commit is contained in:
Eric Bailey
2024-12-16 17:32:56 -06:00
parent 3ef6134915
commit 409809a4b3
2 changed files with 4 additions and 0 deletions
+1
View File
@@ -6,6 +6,7 @@ export const STALE = {
MINUTES: {
ONE: 1e3 * 60,
FIVE: 1e3 * 60 * 5,
THIRTY: 1e3 * 60 * 30,
},
HOURS: {
ONE: 1e3 * 60 * 60,
@@ -4,6 +4,7 @@ import {useQuery} from '@tanstack/react-query'
// TEMP
import {makeSearchLink} from '#/lib/routes/links'
import {STALE} from '#/state/queries'
import {usePreferencesQuery} from '#/state/queries/preferences'
export type TrendingTopic = {
@@ -24,6 +25,8 @@ export function useTrendingTopics() {
}, [preferences?.moderationPrefs])
return useQuery({
refetchOnWindowFocus: true,
staleTime: STALE.MINUTES.THIRTY,
queryKey: trendingTopicsQueryKey,
async queryFn() {
/*