Skip to content

Commit

Permalink
data race fixing.
Browse files Browse the repository at this point in the history
  • Loading branch information
chaos authored and cdujeu committed Mar 25, 2024
1 parent fbef850 commit 8a34d99
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions common/broker/grpcpubsub/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ func (s *sharedSubscriber) Unsubscribe(subId string) {
delete(s.out, subId)
if len(s.out) == 0 && s.cancel != nil {
s.cancel()
subLock.Lock()
delete(subscribers, s.sharedKey)
subLock.Unlock()
}
}

Expand Down

0 comments on commit 8a34d99

Please sign in to comment.