mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 11:07:40 +01:00
fix(system): SystemStats useFetch gets 10s timeoutMs ceiling
/api/system runs four shell tools each capped at 5s; a 10s client-side abort
gives 2× margin for network/render jitter while ensuring a hung call resolves
to FetchErrorState instead of pinning the panel on stale data for the full
30s poll interval. Uses the timeoutMs option introduced in eed1228 for
GitHubStatus.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 file changed
+4
-1
@@ -39,7 +39,10 @@ function UsageBar({ usedMiB, totalMiB }: { usedMiB: number; totalMiB: number })
|
||||
}
|
||||
|
||||
export function SystemStats() {
|
||||
const { data, loading, error, refetch } = useFetch<SystemData>("/api/system", { intervalMs: 30_000 });
|
||||
// 10s ceiling = 2× the server's 5s runTool cap; covers network jitter while
|
||||
// ensuring a hung /api/system call surfaces FetchErrorState instead of
|
||||
// pinning the panel on stale data for the full 30s poll interval.
|
||||
const { data, loading, error, refetch } = useFetch<SystemData>("/api/system", { intervalMs: 30_000, timeoutMs: 10_000 });
|
||||
|
||||
if (loading) {
|
||||
return <div className="animate-pulse text-base text-text-secondary">Loading system status...</div>;
|
||||
|
||||
Reference in new issue
Block a user