🔊 Verbose broadcasting logging

This commit is contained in:
LittleSheep 2024-12-03 21:47:24 +08:00
parent 6f2010cb00
commit cd58e7a429

View File

@ -121,14 +121,18 @@ func BroadcastEvent(event string, data any) error {
Str("event", event). Str("event", event).
Msg("Broadcasting event from internal...") Msg("Broadcasting event from internal...")
for _, val := range resp.Kvs { for idx, val := range resp.Kvs {
var instance ServiceInstance var instance ServiceInstance
if err := json.Unmarshal(val.Value, &instance); err != nil { if err := json.Unmarshal(val.Value, &instance); err != nil {
log.Error().Err(err).Int("index", idx).
Msg("Unable to parse instance config, skip broadcasting for it...")
continue continue
} }
conn, err := instance.GetGrpcConn() conn, err := instance.GetGrpcConn()
if err != nil { if err != nil {
log.Error().Err(err).Str("destination", instance.ID).
Msg("Unable to get grpc connection, skip broadcasting for it...")
continue continue
} }