Skip to content

Commit

Permalink
fix msg done before prometheus
Browse files Browse the repository at this point in the history
  • Loading branch information
lintanghui committed Mar 21, 2019
1 parent ad50cd1 commit b41826d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion proxy/proto/pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,14 @@ func (mp *msgPipe) pipe() {
for i := 0; i < mp.count; i++ {
msg := mp.batch[i]
msg.WithError(err) // NOTE: maybe err is nil
msg.Done()
if prom.On {
if err != nil {
prom.ErrIncr(nc.Cluster(), nc.Addr(), msg.Request().CmdString(), perr.Cause(err).Error())
} else {
prom.HandleTime(nc.Cluster(), nc.Addr(), msg.Request().CmdString(), int64(msg.RemoteDur()/time.Microsecond))
}
}
msg.Done()
}
mp.count = 0
if err != nil {
Expand Down

0 comments on commit b41826d

Please sign in to comment.