Consolidate two overlapping cache systems (broken TanStack persister + per-query Redis hash + pub/sub) into one: TanStack Query as single source of truth with Redis as its persistence layer via createAsyncStoragePersister. - Replace QueryClientProvider with PersistQueryClientProvider backed by Redis - Set global query defaults (staleTime: 0, refetchInterval: 30s, gcTime: 24h) - Remove all per-widget staleTime/refetchInterval/retry/refetchOnWindowFocus overrides - Replace cached request handlers with simplified fetch-only versions - Remove all tRPC subscription procedures and useSubscription calls in favor of polling - Delete 20 cron jobs that only pre-warmed server-side cache - Simplify Redis from per-query hash to single blob per user+board
18 lines
607 B
TypeScript
18 lines
607 B
TypeScript
|
|
import { createIntegrationAsync } from "@homarr/integrations";
|
|
import type { AudiobookshelfDashboardData } from "@homarr/integrations/types";
|
|
|
|
import { createIntegrationRequestHandler } from "./lib/integration-request-handler";
|
|
|
|
export const audiobookshelfRequestHandler = createIntegrationRequestHandler<
|
|
AudiobookshelfDashboardData,
|
|
"audiobookshelf",
|
|
Record<string, never>
|
|
>({
|
|
async requestAsync(integration) {
|
|
const integrationInstance = await createIntegrationAsync(integration);
|
|
return await integrationInstance.getDashboardDataAsync();
|
|
},
|
|
queryKey: "audiobookshelfDashboard",
|
|
});
|