From f6df0f3f4062de8c584a5094dad4ba9b1c87d28e Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 5 Nov 2023 13:39:09 -0300 Subject: [PATCH] rename .mu -> .closeMutex --- relay.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/relay.go b/relay.go index ea69eeb..a21d786 100644 --- a/relay.go +++ b/relay.go @@ -39,7 +39,7 @@ func (s Status) String() string { } type Relay struct { - mu sync.Mutex + closeMutex sync.Mutex URL string RequestHeader http.Header // e.g. for origin header @@ -555,8 +555,8 @@ func (r *Relay) Count(ctx context.Context, filters Filters, opts ...Subscription } func (r *Relay) Close() error { - r.mu.Lock() - defer r.mu.Unlock() + r.closeMutex.Lock() + defer r.closeMutex.Unlock() if r.connectionContextCancel == nil { return fmt.Errorf("relay not connected")