mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-17 15:36:48 +00:00
fix: removed staleTime and cacheTime from query client level (#9124)
* fix: removed staleTime for dashboard API, to fetch fresh data while switching between dashboards * fix: removed query client level staleTime and cacheTime * fix: adding dashbaordID to the query key * fix: removed unnecessary query key
This commit is contained in:
parent
47e8a89dbe
commit
792d0f3db6
@ -16,8 +16,6 @@ const queryClient = new QueryClient({
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
refetchOnWindowFocus: false,
|
||||
staleTime: 2 * 60 * 1000, // 2 minutes - data becomes stale after 2 minutes
|
||||
cacheTime: 5 * 60 * 1000, // 5 minutes - cache entries are garbage collected after 5 minutes
|
||||
retry(failureCount, error): boolean {
|
||||
if (
|
||||
// in case of manually throwing errors please make sure to send error.response.status
|
||||
|
||||
@ -269,7 +269,7 @@ export function DashboardProvider({
|
||||
return data;
|
||||
};
|
||||
const dashboardResponse = useQuery(
|
||||
[REACT_QUERY_KEY.DASHBOARD_BY_ID, isDashboardPage?.params],
|
||||
[REACT_QUERY_KEY.DASHBOARD_BY_ID, dashboardId],
|
||||
{
|
||||
enabled: (!!isDashboardPage || !!isDashboardWidgetPage) && isLoggedIn,
|
||||
queryFn: async () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user