mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-23 03:33:53 +00:00
fix: set PBS status to offline when connection fails (addresses #326)
When both GetVersion and GetDatastores fail for PBS, properly set the Status field to 'offline' and ConnectionHealth to 'error'. This prevents the red dot from appearing when the instance state is undefined.
This commit is contained in:
@@ -1516,6 +1516,8 @@ func (m *Monitor) pollPBSInstance(ctx context.Context, instanceName string, clie
|
||||
Msg("PBS connected (version unavailable but datastores accessible)")
|
||||
} else {
|
||||
// Both failed - PBS is offline
|
||||
pbsInst.Status = "offline"
|
||||
pbsInst.ConnectionHealth = "error"
|
||||
monErr := errors.WrapConnectionError("get_pbs_version", instanceName, versionErr)
|
||||
log.Error().Err(monErr).Str("instance", instanceName).Msg("Failed to connect to PBS")
|
||||
m.state.SetConnectionHealth("pbs-"+instanceName, false)
|
||||
|
||||
Reference in New Issue
Block a user