Peter Makowski has proposed merging
~petermakowski/maas-site-manager:MAASENG-1504-add-sites-polling into
maas-site-manager:main.
Requested reviews:
MAAS Committers (maas-committers)
For more details, see:
https://code.launchpad.net/~petermakowski/maas-site-manager/+git/site-manager/+merge/439619
QA Steps
- Open developer tools and go to network tab
- Go to sites
- Verify you can see /sites api request on the list
- Navigate to a different page
- Another API request should be made
- Wait 30 seconds
- Another request should be made for the currently visible page
--
Your team MAAS Committers is requested to review the proposed merge of
~petermakowski/maas-site-manager:MAASENG-1504-add-sites-polling into
maas-site-manager:main.
diff --git a/frontend/src/hooks/api.ts b/frontend/src/hooks/api.ts
index 1d29152..921b83e 100644
--- a/frontend/src/hooks/api.ts
+++ b/frontend/src/hooks/api.ts
@@ -6,11 +6,14 @@ import type { SitesQueryResult, PostTokensResult } from "@/api/types";
export type UseSitesQueryResult = ReturnType<typeof useSitesQuery>;
+// 30 seconds
+const defaultRefetchInterval = 30 * 1000;
export const useSitesQuery = ({ page, size }: GetSitesQueryParams, queryText?: string) =>
useQuery<SitesQueryResult>({
queryKey: ["sites", page, size, queryText],
queryFn: () => getSites({ page, size }, queryText),
keepPreviousData: true,
+ refetchInterval: defaultRefetchInterval,
});
export type useTokensQueryResult = ReturnType<typeof useTokensQuery>;
--
Mailing list: https://launchpad.net/~sts-sponsors
Post to : [email protected]
Unsubscribe : https://launchpad.net/~sts-sponsors
More help : https://help.launchpad.net/ListHelp