当修改节点在线状态时重置上线检查次数

This commit is contained in:
GoEdgeLab
2021-08-29 16:57:50 +08:00
parent b06e65d599
commit f6b34bccf9

View File

@@ -1154,15 +1154,19 @@ func (this *NodeDAO) UpdateNodeUp(tx *dbs.Tx, nodeId int64, isUp bool) error {
if nodeId <= 0 {
return errors.New("invalid nodeId")
}
op := NewNodeOperator()
op.Id = nodeId
op.IsUp = isUp
op.CountDown = 0
op.CountUp = 0
op.CountDown = 0
err := this.Save(tx, op)
if err != nil {
return err
}
// TODO 只有前后状态不一致的时候才需要更新DNS
return this.NotifyDNSUpdate(tx, nodeId)
}