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:
xiaomiku01
2026-04-11 18:40:27 +08:00
parent 50f8548479
commit 9a5959b57e
5 changed files with 24 additions and 15 deletions

View File

@@ -169,7 +169,9 @@ func (sys *System) update() error {
}
// Fetch and save network probe results
go sys.fetchAndSaveProbeResults()
if sys.hasEnabledProbes() {
go sys.fetchAndSaveProbeResults()
}
return err
}