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:
xakdwch
2023-03-03 09:50:14 +08:00
parent c6beef8f0e
commit c767f429f0
2 changed files with 3 additions and 3 deletions

View File

@ -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) {