fix batcher is nil

v4
vinllen 5 years ago
parent c4f437a617
commit 5bdfb5070c
  1. 7
      src/redis-shake/common/cluster.go

@ -54,9 +54,16 @@ func (cc *ClusterConn) Send(commandName string, args ...interface{}) error {
// send batcher and put the return into recvChan
func (cc *ClusterConn) Flush() error {
ret, err := cc.client.RunBatch(cc.batcher)
defer func() {
cc.batcher = nil // reset batcher
}()
if err != nil {
cc.recvChan <- reply{
answer: nil,
err: err,
}
return err
}

Loading…
Cancel
Save