Skip to content

Commit

Permalink
chore: restore previous state
Browse files Browse the repository at this point in the history
Signed-off-by: D4ryl00 <[email protected]>
  • Loading branch information
D4ryl00 committed Aug 5, 2024
1 parent 7cfbd32 commit d3037f9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions sync_inmem_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,18 +117,14 @@ func (ps *PubSub) handleStream(s inet.Stream) {
for {
var req pb.Message

defer func() {
err := r.ReadMsg(&req)
if err != nil {
for ns := range subscribedTopics {
topic := ps.getOrCreateTopic(ns)
topic.mu.Lock()
delete(topic.subscribers, s.Conn().RemotePeer())
topic.mu.Unlock()
}
}()

err := r.ReadMsg(&req)
if err != nil {
log.Errorf("unable to read from stream: %s", err.Error())
return
}

Expand Down

0 comments on commit d3037f9

Please sign in to comment.