From 452d49b8bcd988807d6ccccecf22534087a48fa4 Mon Sep 17 00:00:00 2001 From: tian <11429339@qq.com> Date: Sun, 2 Aug 2026 12:37:53 +0800 Subject: [PATCH] =?UTF-8?q?debug:=20gp=20=E6=97=A5=E5=BF=972?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- control/internal/service/registry.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/control/internal/service/registry.go b/control/internal/service/registry.go index 4e53a73..d582a1b 100644 --- a/control/internal/service/registry.go +++ b/control/internal/service/registry.go @@ -1,6 +1,7 @@ package service import ( + "log" "encoding/json" "sort" "strings" @@ -92,6 +93,7 @@ func (s *RegistryService) startGraphPolling() { onlineDevices = append(onlineDevices, dev) } } + log.Printf("[gp] tick total=%d online=%d", len(s.devices), len(onlineDevices)) s.mu.RUnlock() for _, dev := range onlineDevices { @@ -104,6 +106,7 @@ func (s *RegistryService) startGraphPolling() { continue } total, online, down := parseVideoSourceStats(graphs) + log.Printf("[gp] device=%s vs_total=%d vs_online=%d vs_down=%d", dev.DeviceID, total, online, down) s.mu.Lock() // discovery 可能已替换设备指针,更新 registry 中当前对象 if cur, ok := s.devices[dev.DeviceID]; ok { @@ -111,6 +114,9 @@ func (s *RegistryService) startGraphPolling() { cur.VideoSourceTotal = total cur.VideoSourceOnline = online cur.VideoSourceDown = down + log.Printf("[gp] updated %s vs_down=%d", dev.DeviceID, cur.VideoSourceDown) + } else { + log.Printf("[gp] MISSING device %s in registry", dev.DeviceID) } s.mu.Unlock() }