mirror of
https://github.com/moghtech/komodo.git
synced 2025-12-05 19:17:36 -06:00
[PR #843] [MERGED] Fix unnecessary API queries to unreachable servers flooding console #805
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/moghtech/komodo/pull/843
Author: @MP-Tool
Created: 9/12/2025
Status: ✅ Merged
Merged: 9/14/2025
Merged by: @mbecker20
Base:
1.19.4← Head:fix/server-status-based-api-queries📝 Commits (2)
230700cImplement server availability checks in various components183a963Refactor server availability check to ensure only healthy servers are identified📊 Changes
3 files changed (+37 additions, -15 deletions)
View changed files
📝
frontend/src/components/resources/server/index.tsx(+14 -8)📝
frontend/src/components/resources/server/monitoring-table.tsx(+12 -3)📝
frontend/src/components/resources/server/stats.tsx(+11 -4)📄 Description
Problem:
While working on server management, I noticed that the frontend was making tons of unnecessary API calls to servers that have a "Not OK" status. Every time you visit a server page with an unreachable server, the UI tries to fetch system stats, CPU info, memory data, and container information - all of which are guaranteed to fail with 500 errors, flooding the browser console.
This creates several issues:
GetSystemStatsandGetSystemInformationSolution:
I've added server availability guards to prevent API calls to unreachable servers:
useIsServerAvailable()that checks if server state is notDisabledorNotOkenabledoption to check server availability firstThe fix uses React Query's
enabledoption with server status checks:This means:
The changes are backward compatible and respect existing server status logic that was already in place in some components.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.