From 89f4e9d7ef409658db7ea4b5174e2c873cd7863b Mon Sep 17 00:00:00 2001 From: Mario de Frutos Dieguez Date: Tue, 3 Mar 2020 11:53:32 +0100 Subject: [PATCH] Metrics operations shouldn't be inside goroutine (#13950) Metrics operations are done in memory so there is no need to spawn a new goroutine --- app/web_conn.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/web_conn.go b/app/web_conn.go index 1a7da373e2..c4919a6e9b 100644 --- a/app/web_conn.go +++ b/app/web_conn.go @@ -232,9 +232,7 @@ func (wc *WebConn) writePump() { } if wc.App.Metrics() != nil { - wc.App.Srv().Go(func() { - wc.App.Metrics().IncrementWebSocketBroadcast(msg.EventType()) - }) + wc.App.Metrics().IncrementWebSocketBroadcast(msg.EventType()) } }