实现节点自动切换到备用IP

This commit is contained in:
刘祥超
2021-09-13 10:51:05 +08:00
parent 7fcc2b7dba
commit 0b8501a724
14 changed files with 112 additions and 39 deletions

View File

@@ -234,3 +234,11 @@ func (this *NodeIPAddressThresholdDAO) formatThreshold(tx *dbs.Tx, threshold *No
return nil
}
// ExistsEnabledThreshold 检查阈值是否可以使用
func (this *NodeIPAddressThresholdDAO) ExistsEnabledThreshold(tx *dbs.Tx, thresholdId int64) (bool, error) {
return this.Query(tx).
Pk(thresholdId).
State(NodeIPAddressThresholdStateEnabled).
Exist()
}