fix(beszel): disable request handler cache for stats to make live mode work (#6244)

This commit is contained in:
Thomas authored and GitHub committed 2026-07-10 17:16:23 +02:00
1 parent 0e513fffd5
commit 24c5d04bfa
8 files changed
+269 -9

No files matched your search

+3
View File
@@ -122,6 +122,9 @@ export const beszelStatsRequestHandler = createIntegrationRequestHandler<
"beszel" | "mock",
{ systemId: string; timePeriod: string; includeDocker: boolean }
>({
// No cache — the widget polls every 5s for live updates;
// a TTL here would serve stale records between polls.
cacheTtlMs: 0,
async requestAsync(integration, input) {
const start = performance.now();
const config = timePeriodConfig[input.timePeriod] ?? { type: "1m", perPage: 60 };
@@ -12,6 +12,7 @@ type IntegrationOfKind<TKind extends IntegrationKind> = Omit<Integration, "kind"
interface Options<TData, TKind extends IntegrationKind, TInput extends Record<string, unknown>> {
requestAsync: (integration: IntegrationOfKind<TKind>, input: TInput) => Promise<TData>;
cacheTtlMs?: number;
}
export const createIntegrationRequestHandler = <
@@ -30,6 +31,7 @@ export const createIntegrationRequestHandler = <
}
return options.requestAsync(integration, input.options);
},
cacheTtlMs: options.cacheTtlMs,
});
return {