mirror of
https://github.com/henrygd/beszel.git
synced 2026-04-21 12:11:49 +02:00
fix: address network probe code quality issues
- Use shared http.Client in ProbeManager to avoid connection/transport leak - Skip probe goroutine and agent request when system has no enabled probes - Validate HTTP probe target URL scheme (http:// or https://) on creation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -168,8 +168,10 @@ func (sm *SystemManager) fetchRealtimeDataAndNotify() {
|
||||
Containers: data.Containers,
|
||||
}
|
||||
// Fetch network probe results (lightweight in-memory read on agent)
|
||||
if probes, err := sys.FetchNetworkProbeResults(); err == nil && len(probes) > 0 {
|
||||
payload.Probes = probes
|
||||
if sys.hasEnabledProbes() {
|
||||
if probes, err := sys.FetchNetworkProbeResults(); err == nil && len(probes) > 0 {
|
||||
payload.Probes = probes
|
||||
}
|
||||
}
|
||||
bytes, err := json.Marshal(payload)
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user