mirror of
https://github.com/langgenius/dify.git
synced 2026-02-24 09:55:09 +00:00
- Fix double-nested queryKey array in usePluginManifestInfo that broke invalidateQueries prefix matching - Remove unnecessary useState in TanstackQueryInitializer per Advanced SSR guide https://tanstack.com/query/v5/docs/framework/react/guides/advanced-ssr#initial-setup - Reduce default staleTime from 30min to 5min (matching gcTime default) - Fix nuqs SearchParams import to use nuqs/server for consistency
17 lines
346 B
TypeScript
17 lines
346 B
TypeScript
import { QueryClient } from '@tanstack/react-query'
|
|
import { cache } from 'react'
|
|
|
|
const STALE_TIME = 1000 * 60 * 5 // 5 minutes
|
|
|
|
export function makeQueryClient() {
|
|
return new QueryClient({
|
|
defaultOptions: {
|
|
queries: {
|
|
staleTime: STALE_TIME,
|
|
},
|
|
},
|
|
})
|
|
}
|
|
|
|
export const getQueryClientServer = cache(makeQueryClient)
|