20 lines
716 B
TypeScript
20 lines
716 B
TypeScript
"use client";
|
|
|
|
import { QueryClient } from "@tanstack/react-query";
|
|
|
|
export const queryClient = new QueryClient({
|
|
defaultOptions: {
|
|
queries: {
|
|
staleTime: 30_000,
|
|
retry: 1,
|
|
// Several pages poll on an interval - the fleet list every 30s, run logs
|
|
// faster than that. A hidden tab was still doing all of it, so a console
|
|
// left open overnight in a background tab kept refetching the fleet and
|
|
// its inventory blobs until the session expired. The default here rather
|
|
// than per page, because the argument is the same everywhere and the
|
|
// pages that poll are exactly the ones nobody remembers to check.
|
|
refetchIntervalInBackground: false,
|
|
},
|
|
},
|
|
});
|