mirror of
https://github.com/lorsanstand/HomeOps-Hub.git
synced 2026-06-19 16:45:15 +03:00
refactor: comma-ok in listenHeartbeat
This commit is contained in:
@@ -90,9 +90,12 @@ func (a *AgentConnection) listenHeartbeat(heartbeats <-chan domainHub.CreateHear
|
|||||||
}
|
}
|
||||||
|
|
||||||
a.log.Warn().Msg("agent not send heartbeat")
|
a.log.Warn().Msg("agent not send heartbeat")
|
||||||
a.Close()
|
_ = a.Close()
|
||||||
return
|
return
|
||||||
case heartbeat := <-heartbeats:
|
case heartbeat, ok := <-heartbeats:
|
||||||
|
if !ok {
|
||||||
|
return
|
||||||
|
}
|
||||||
a.log.Debug().
|
a.log.Debug().
|
||||||
Float64("cpu usage", heartbeat.Metrics.CpuUsage).
|
Float64("cpu usage", heartbeat.Metrics.CpuUsage).
|
||||||
Float64("disk usage", heartbeat.Metrics.DiskUsage).
|
Float64("disk usage", heartbeat.Metrics.DiskUsage).
|
||||||
|
|||||||
Reference in New Issue
Block a user