Skip to content

Commit f692f1c

Browse files
committed
Removes the lock I put on 👀
1 parent 8209696 commit f692f1c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

exchanges/stream/websocket.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,9 +342,9 @@ func (w *Websocket) connectionMonitor() error {
342342
if w.checkAndSetMonitorRunning() {
343343
return errAlreadyRunning
344344
}
345-
w.m.Lock()
345+
w.connectionMutex.RLock()
346346
delay := w.connectionMonitorDelay
347-
w.m.Unlock()
347+
w.connectionMutex.RUnlock()
348348

349349
go func() {
350350
timer := time.NewTimer(delay)

exchanges/stream/websocket_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,7 @@ func TestConnectionMonitorNoConnection(t *testing.T) {
603603
if !errors.Is(err, errAlreadyRunning) {
604604
t.Fatalf("received: %v, but expected: %v", err, errAlreadyRunning)
605605
}
606+
ws.setEnabled(false)
606607
}
607608

608609
// TestSliceCopyDoesntImpactBoth logic test

0 commit comments

Comments
 (0)