diff --git a/README.md b/README.md index a0d34b6..feddbbf 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@
:trollface: 哪吒监控 一站式轻监控轻运维系统。支持系统状态、HTTP(SSL 证书变更、即将到期、到期)、TCP、Ping 监控报警,命令批量执行和计划任务。
diff --git a/cmd/dashboard/main.go b/cmd/dashboard/main.go index 5f76afc..39a9dff 100644 --- a/cmd/dashboard/main.go +++ b/cmd/dashboard/main.go @@ -120,7 +120,11 @@ func cleanMonitorHistory() { for id, couldRemove := range specialServerKeep { dao.DB.Unscoped().Delete(&model.Transfer{}, "id = ? AND created_at < ?", id, couldRemove) } - dao.DB.Unscoped().Delete(&model.Transfer{}, "id NOT IN (?) AND created_at < ?", specialServerIDs, allServerKeep) + if allServerKeep.IsZero() { + dao.DB.Unscoped().Delete(&model.Transfer{}, "id NOT IN (?)", specialServerIDs) + } else { + dao.DB.Unscoped().Delete(&model.Transfer{}, "id NOT IN (?) AND created_at < ?", specialServerIDs, allServerKeep) + } } func loadServers() { diff --git a/service/dao/dao.go b/service/dao/dao.go index d0dbada..0b9096e 100644 --- a/service/dao/dao.go +++ b/service/dao/dao.go @@ -13,7 +13,7 @@ import ( pb "github.com/naiba/nezha/proto" ) -var Version = "v0.9.0" // !!记得修改 README 中的 badge 版本!! +var Version = "v0.9.1" // !!记得修改 README 中的 badge 版本!! var ( Conf *model.Config