Skip to content

Commit

Permalink
remove redundant select {}
Browse files Browse the repository at this point in the history
  • Loading branch information
or-else committed Jan 29, 2019
1 parent 0cfd775 commit b7fc4de
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions server/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,22 +218,21 @@ func (n *ClusterNode) callAsync(proc string, msg, resp interface{}, done chan *r

myDone := make(chan *rpc.Call, 1)
go func() {
select {
case call := <-myDone:
if call.Error != nil {
n.lock.Lock()
if n.connected {
n.endpoint.Close()
n.connected = false
go n.reconnect()
}
n.lock.Unlock()
call := <-myDone
if call.Error != nil {
n.lock.Lock()
if n.connected {
n.endpoint.Close()
n.connected = false
go n.reconnect()
}
n.lock.Unlock()
}

if done != nil {
done <- call
}
if done != nil {
done <- call
}

}()

call := n.endpoint.Go(proc, msg, resp, myDone)
Expand Down

0 comments on commit b7fc4de

Please sign in to comment.