From 321ccce93104554d6276dfbd145d3b087151644d Mon Sep 17 00:00:00 2001 From: naiba Date: Thu, 15 Jul 2021 00:07:02 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20=E6=B5=81=E9=87=8F?= =?UTF-8?q?=E8=AE=B0=E5=BD=95=E6=B8=85=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- cmd/dashboard/main.go | 6 +++++- service/dao/dao.go | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) 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