rafthttp: replace inline code with existing function
The isMsgApp function implements the judgment of the MsgApp message, use the isMsgApp function instead. Signed-off-by: xakdwch <xakdwch5@gmail.com>
This commit is contained in:
@ -103,7 +103,7 @@ func (p *pipeline) handle() {
|
||||
if err != nil {
|
||||
p.status.deactivate(failureType{source: pipelineMsg, action: "write"}, err.Error())
|
||||
|
||||
if m.Type == raftpb.MsgApp && p.followerStats != nil {
|
||||
if isMsgApp(m) && p.followerStats != nil {
|
||||
p.followerStats.Fail()
|
||||
}
|
||||
p.raft.ReportUnreachable(m.To)
|
||||
@ -115,7 +115,7 @@ func (p *pipeline) handle() {
|
||||
}
|
||||
|
||||
p.status.activate()
|
||||
if m.Type == raftpb.MsgApp && p.followerStats != nil {
|
||||
if isMsgApp(m) && p.followerStats != nil {
|
||||
p.followerStats.Succ(end.Sub(start))
|
||||
}
|
||||
if isMsgSnap(m) {
|
||||
|
Reference in New Issue
Block a user