Skip to content

Self-hosted, plugin-based server management.

Reduce automatic pinging

LukeGusd88c890ba7d1
diff --git a/src/backend/ssh/server-stats.ts b/src/backend/ssh/server-stats.ts
index 2fd66bd16..7f79dee31 100644
--- a/src/backend/ssh/server-stats.ts
+++ b/src/backend/ssh/server-stats.ts
@@ -415,7 +415,8 @@ app.listen(PORT, async () => {
}
});
-setInterval(() => {
- pollStatusesOnce().catch(err => logger.error('Background poll failed', err));
-}, 60_000);
+// Disable automatic background polling to prevent log flooding
+// setInterval(() => {
+// pollStatusesOnce().catch(err => logger.error('Background poll failed', err));
+// }, 60_000);
diff --git a/src/ui/Navigation/LeftSidebar.tsx b/src/ui/Navigation/LeftSidebar.tsx
index d75f182a6..f60383a92 100644
--- a/src/ui/Navigation/LeftSidebar.tsx
+++ b/src/ui/Navigation/LeftSidebar.tsx
@@ -238,7 +238,7 @@ export function LeftSidebar({
React.useEffect(() => {
fetchHosts();
- const interval = setInterval(fetchHosts, 10000);
+ const interval = setInterval(fetchHosts, 300000); // 5 minutes instead of 10 seconds
return () => clearInterval(interval);
}, [fetchHosts]);
diff --git a/src/ui/apps/Server/Server.tsx b/src/ui/apps/Server/Server.tsx
index be6a44704..3af2a6636 100644
--- a/src/ui/apps/Server/Server.tsx
+++ b/src/ui/apps/Server/Server.tsx
@@ -94,20 +94,23 @@ export function Server({
}
};
- if (currentHostConfig?.id) {
+ if (currentHostConfig?.id && isVisible) {
fetchStatus();
fetchMetrics();
+ // Only poll when component is visible to reduce unnecessary connections
intervalId = window.setInterval(() => {
- fetchStatus();
- fetchMetrics();
- }, 10_000);
+ if (isVisible) {
+ fetchStatus();
+ fetchMetrics();
+ }
+ }, 300_000); // 5 minutes instead of 10 seconds
}
return () => {
cancelled = true;
if (intervalId) window.clearInterval(intervalId);
};
- }, [currentHostConfig?.id]);
+ }, [currentHostConfig?.id, isVisible]);
const topMarginPx = isTopbarOpen ? 74 : 16;
const leftMarginPx = sidebarState === 'collapsed' ? 16 : 8;
@@ -142,7 +145,26 @@ export function Server({
<StatusIndicator/>
</Status>
</div>
- <div className="flex items-center">
+ <div className="flex items-center gap-2">
+ <Button
+ variant="outline"
+ onClick={async () => {
+ if (currentHostConfig?.id) {
+ try {
+ const res = await getServerStatusById(currentHostConfig.id);
+ setServerStatus(res?.status === 'online' ? 'online' : 'offline');
+ const data = await getServerMetricsById(currentHostConfig.id);
+ setMetrics(data);
+ } catch {
+ setServerStatus('offline');
+ setMetrics(null);
+ }
+ }
+ }}
+ title="Refresh status and metrics"
+ >
+ Refresh
+ </Button>
{currentHostConfig?.enableFileManager && (
<Button
variant="outline"