Refetch live events every 5 min (#9706)

This commit is contained in:
Eric Bailey
2026-01-15 16:26:44 -06:00
committed by GitHub
parent 367eebe600
commit 1d4263078d
+4 -2
View File
@@ -7,7 +7,7 @@ import {
isBskyCustomFeedUrl, isBskyCustomFeedUrl,
makeRecordUri, makeRecordUri,
} from '#/lib/strings/url-helpers' } from '#/lib/strings/url-helpers'
import {IS_DEV, LIVE_EVENTS_URL} from '#/env' import {LIVE_EVENTS_URL} from '#/env'
import {useLiveEventPreferences} from '#/features/liveEvents/preferences' import {useLiveEventPreferences} from '#/features/liveEvents/preferences'
import {type LiveEventsWorkerResponse} from '#/features/liveEvents/types' import {type LiveEventsWorkerResponse} from '#/features/liveEvents/types'
import {useDevMode} from '#/storage/hooks/dev-mode' import {useDevMode} from '#/storage/hooks/dev-mode'
@@ -37,8 +37,10 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
const isBskyTeam = useIsBskyTeam() const isBskyTeam = useIsBskyTeam()
const {data} = useQuery( const {data} = useQuery(
{ {
staleTime: IS_DEV ? 5e3 : 1000 * 60, // keep this, prefectching handles initial load
staleTime: 1000 * 15,
queryKey: liveEventsQueryKey, queryKey: liveEventsQueryKey,
refetchInterval: 1000 * 60 * 5,
async queryFn() { async queryFn() {
return fetchLiveEvents() return fetchLiveEvents()
}, },