Skip to content

Commit

Permalink
check if channel is closed before continuing
Browse files Browse the repository at this point in the history
  • Loading branch information
henrod committed May 21, 2018
1 parent bc5ecce commit f02ed4d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/unique_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,13 @@ func NewUniqueSession(server *cluster.Server, rpcServer *cluster.NatsRPCServer,
}

func (u *UniqueSession) processBindings(bindingsChan chan *nats.Msg) {
loop:
for {
select {
case s := <-bindingsChan:
case s, ok := <-bindingsChan:
if !ok {
break loop
}
msgData := s.Data
msg := &BindingMsg{}
err := json.Unmarshal(msgData, msg)
Expand Down

0 comments on commit f02ed4d

Please sign in to comment.