rename .mu -> .closeMutex

This commit is contained in:
fiatjaf 2023-11-05 13:39:09 -03:00
parent 20d65d4a76
commit f6df0f3f40
No known key found for this signature in database
GPG Key ID: BAD43C4BE5C1A3A1

View File

@ -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")