Skip to content

Commit

Permalink
add comments to improve readability
Browse files Browse the repository at this point in the history
Signed-off-by: aryan <aryangodara03@gmail.com>
  • Loading branch information
AryanGodara committed Aug 12, 2022
1 parent c3e8065 commit d484937
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 the ps mutex 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 the ps mutex is unlocked
s = ps.subscriptions[topic]
}
}
Expand Down

0 comments on commit d484937

Please sign in to comment.