increase refresh rate

This commit is contained in:
miloschwartz
2026-04-26 16:57:10 -07:00
parent 6befdfe01e
commit 06af53c4d6
4 changed files with 12 additions and 6 deletions

View File

@@ -36,7 +36,7 @@ import { useTranslations } from "next-intl";
import Link from "next/link";
import { useRouter } from "next/navigation";
import { Selectedsite, SitesSelector } from "@app/components/site-selector";
import { useMemo, useState, useTransition } from "react";
import { useEffect, useMemo, useState, useTransition } from "react";
import CreateInternalResourceDialog from "@app/components/CreateInternalResourceDialog";
import EditInternalResourceDialog from "@app/components/EditInternalResourceDialog";
@@ -144,6 +144,13 @@ export default function ClientResourcesTable({
const [isRefreshing, startTransition] = useTransition();
useEffect(() => {
const interval = setInterval(() => {
router.refresh();
}, 30_000);
return () => clearInterval(interval);
}, [router]);
const siteIdQ = searchParams.get("siteId");
const siteIdNum = siteIdQ ? parseInt(siteIdQ, 10) : NaN;
const selectedSite: Selectedsite | null = useMemo(() => {

View File

@@ -166,7 +166,7 @@ export default function HealthChecksTable({
useEffect(() => {
const interval = setInterval(() => {
router.refresh();
}, 10_000);
}, 30_000);
return () => clearInterval(interval);
}, [router]);

View File

@@ -178,7 +178,7 @@ export default function ProxyResourcesTable({
useEffect(() => {
const interval = setInterval(() => {
router.refresh();
}, 10_000);
}, 30_000);
return () => clearInterval(interval);
}, [router]);
@@ -387,8 +387,7 @@ export default function ProxyResourcesTable({
},
{
id: "sites",
accessorFn: (row) =>
row.sites.map((s) => s.siteName).join(", "),
accessorFn: (row) => row.sites.map((s) => s.siteName).join(", "),
friendlyName: t("sites"),
header: () => (
<Popover open={siteFilterOpen} onOpenChange={setSiteFilterOpen}>

View File

@@ -102,7 +102,7 @@ export default function SitesTable({
useEffect(() => {
const interval = setInterval(() => {
router.refresh();
}, 10_000);
}, 30_000);
return () => clearInterval(interval);
}, []);