From 3484d063c8923931db0a053798cf7bf37c672f9d Mon Sep 17 00:00:00 2001 From: theluckystrike <51033404+theluckystrike@users.noreply.github.com> Date: Wed, 4 Mar 2026 22:01:54 +0700 Subject: [PATCH] fix: lazy load repository stats on-demand The repositories page was eagerly fetching restic stats on every page load, which causes high CPU/Memory usage for large repositories (especially multi-TB Backblaze repos). This fix removes the eager loading from the route loader, so stats are now fetched on-demand by the frontend component instead. This resolves the issue where: - Loading the repository page would trigger restic stats immediately - Refreshing the page would trigger additional calls to restic stats - Resource consumption would ramp up significantly Fixes #614 --- .../(dashboard)/repositories/$repositoryId/index.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/routes/(dashboard)/repositories/$repositoryId/index.tsx b/app/routes/(dashboard)/repositories/$repositoryId/index.tsx index 0e7158f6..0857b703 100644 --- a/app/routes/(dashboard)/repositories/$repositoryId/index.tsx +++ b/app/routes/(dashboard)/repositories/$repositoryId/index.tsx @@ -2,7 +2,6 @@ import { createFileRoute } from "@tanstack/react-router"; import { type } from "arktype"; import { getRepositoryOptions, - getRepositoryStatsOptions, listBackupSchedulesOptions, listSnapshotsOptions, } from "~/client/api-client/@tanstack/react-query.gen"; @@ -14,20 +13,17 @@ export const Route = createFileRoute("/(dashboard)/repositories/$repositoryId/") errorComponent: (e) =>