Skip to content

Commit

Permalink
Fix invalid lock
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Piotrowski <[email protected]>
  • Loading branch information
piotrpio committed Jul 19, 2023
1 parent 852e1a9 commit 77c4c1c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion js.go
Original file line number Diff line number Diff line change
Expand Up @@ -686,11 +686,11 @@ func (js *js) newAsyncReply() string {

func (js *js) resetPendingAcksOnReconnect() {
for {
js.mu.Lock()
newStatus, ok := <-js.connStatusCh
if !ok || newStatus == CLOSED {
return
}
js.mu.Lock()
for _, paf := range js.pafs {
paf.err = ErrDisconnected
}
Expand Down
2 changes: 1 addition & 1 deletion nats.go
Original file line number Diff line number Diff line change
Expand Up @@ -5471,7 +5471,7 @@ func (nc *Conn) StatusChanged(statuses ...Status) chan Status {
if len(statuses) == 0 {
statuses = []Status{CONNECTED, RECONNECTING, DISCONNECTED, CLOSED}
}
ch := make(chan Status)
ch := make(chan Status, 10)
for _, s := range statuses {
nc.registerStatusChangeListener(s, ch)
}
Expand Down

0 comments on commit 77c4c1c

Please sign in to comment.