Skip to content

Commit

Permalink
add comment to improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
AryanGodara committed Aug 12, 2022
1 parent c3e8065 commit e3629a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/messaging/nats/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func (ps *pubsub) Subscribe(id, topic string, handler messaging.MessageHandler)
}

ps.mu.Lock()
// value of s can changed while ps.mu is unlocked
s = ps.subscriptions[topic]
}
}
Expand Down
1 change: 1 addition & 0 deletions pkg/messaging/rabbitmq/pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ func (ps *pubsub) Subscribe(id, topic string, handler messaging.MessageHandler)
}

ps.mu.Lock()
// value of s can changed while ps.mu is unlocked
s = ps.subscriptions[topic]
}
}
Expand Down

0 comments on commit e3629a6

Please sign in to comment.