fix: prune stale agent traffic counters

This commit is contained in:
sagitchu
2026-04-30 09:54:02 +08:00
parent f05e9480ee
commit b4192c9e94
6 changed files with 178 additions and 5 deletions
+7
View File
@@ -234,6 +234,13 @@ func (p *program) reloadConfig() error {
if err := loader.Load(cfg); err != nil {
return err
}
activeServices := make(map[string]struct{}, len(cfg.Services))
for _, svc := range cfg.Services {
if svc != nil {
activeServices[svc.Name] = struct{}{}
}
}
xservice.GetGlobalTrafficManager().RetainServices(activeServices)
if err := p.run(cfg); err != nil {
return err