From bdce170859bb3237df93abed306a8e82892e83b1 Mon Sep 17 00:00:00 2001 From: Termina1 Date: Mon, 9 Sep 2024 22:35:09 +0300 Subject: [PATCH] fix metric --- chotki.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chotki.go b/chotki.go index 78c6233..fabfb7d 100644 --- a/chotki.go +++ b/chotki.go @@ -438,8 +438,8 @@ func (cho *Chotki) RemoveAllHooks(fid rdx.ID) { func (cho *Chotki) Broadcast(records protocol.Records, except string) { cho.outq.Range(func(name string, hose protocol.DrainCloser) bool { if name != except { + EventsOutboundMetric.WithLabelValues(name).Add(float64(len(records))) if err := hose.Drain(records); err != nil { - EventsOutboundMetric.WithLabelValues(name).Add(float64(len(records))) cho.log.Error("couldn't drain to hose", "err", err) cho.outq.Delete(name) }