集群被删除或者不可用时,健康检查时不提示错误

This commit is contained in:
GoEdgeLab
2022-11-16 14:10:03 +08:00
parent d9ca7fdca1
commit 0fa7d43cba

View File

@@ -38,8 +38,9 @@ func (this *HealthCheckExecutor) Run() ([]*HealthCheckResult, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
if cluster == nil { if cluster == nil || !cluster.IsOn {
return nil, errors.New("can not find cluster with id '" + strconv.FormatInt(this.clusterId, 10) + "'") // 如果节点已经被删除,则不提示错误
return nil, nil
} }
if !cluster.HealthCheck.IsNotNull() { if !cluster.HealthCheck.IsNotNull() {
return nil, errors.New("health check config is not found") return nil, errors.New("health check config is not found")