From a0d9f3a392901d16ba2afce78719338fbef69f83 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 5 Feb 2023 20:03:00 -0300 Subject: [PATCH] send notices on a goroutine. --- relay.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/relay.go b/relay.go index bba3368..2000a08 100644 --- a/relay.go +++ b/relay.go @@ -123,7 +123,9 @@ func (r *Relay) Connect(ctx context.Context) error { case "NOTICE": var content string json.Unmarshal(jsonMessage[1], &content) - r.Notices <- content + go func() { + r.Notices <- content + }() case "AUTH": var challenge string json.Unmarshal(jsonMessage[1], &challenge)