diff --git a/src/modules/monapi/scache/aggr.go b/src/modules/monapi/scache/aggr.go index b8238b08..71c59b9e 100644 --- a/src/modules/monapi/scache/aggr.go +++ b/src/modules/monapi/scache/aggr.go @@ -103,7 +103,7 @@ func cleanAggrCalcStra() { continue } - if node.Id == 0 { + if node == nil { logger.Infof("delete aggr_calc stra:%d", stra.Id) if err := models.AggrCalcDel(stra.Id); err != nil { logger.Warningf("delete stra: %d, err: %v", stra.Id, err) diff --git a/src/modules/monapi/scache/collect.go b/src/modules/monapi/scache/collect.go index 20619c3a..534795ec 100644 --- a/src/modules/monapi/scache/collect.go +++ b/src/modules/monapi/scache/collect.go @@ -217,7 +217,7 @@ func cleanCollect() { continue } - if node.Id == 0 { + if node == nil { logger.Infof("delete collect: %+v", collect) if err := models.DeleteCollectById(collectType, "sys", id); err != nil { logger.Warningf("delete collect %s: %d, err: %v", collectType, id, err) diff --git a/src/modules/monapi/scache/stra.go b/src/modules/monapi/scache/stra.go index 802d1aff..13a85483 100644 --- a/src/modules/monapi/scache/stra.go +++ b/src/modules/monapi/scache/stra.go @@ -116,7 +116,7 @@ func cleanStra() { continue } - if node.Id == 0 { + if node == nil { logger.Infof("delete stra:%d", stra.Id) if err := models.StraDel(stra.Id); err != nil { logger.Warningf("delete stra: %d, err: %v", stra.Id, err)