mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-21 05:40:25 +08:00
当修改节点在线状态时重置上线检查次数
This commit is contained in:
@@ -1154,15 +1154,19 @@ func (this *NodeDAO) UpdateNodeUp(tx *dbs.Tx, nodeId int64, isUp bool) error {
|
|||||||
if nodeId <= 0 {
|
if nodeId <= 0 {
|
||||||
return errors.New("invalid nodeId")
|
return errors.New("invalid nodeId")
|
||||||
}
|
}
|
||||||
|
|
||||||
op := NewNodeOperator()
|
op := NewNodeOperator()
|
||||||
op.Id = nodeId
|
op.Id = nodeId
|
||||||
op.IsUp = isUp
|
op.IsUp = isUp
|
||||||
op.CountDown = 0
|
op.CountUp = 0
|
||||||
op.CountDown = 0
|
op.CountDown = 0
|
||||||
err := this.Save(tx, op)
|
err := this.Save(tx, op)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO 只有前后状态不一致的时候才需要更新DNS
|
||||||
|
|
||||||
return this.NotifyDNSUpdate(tx, nodeId)
|
return this.NotifyDNSUpdate(tx, nodeId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user