From e4e15d0c570a5c1e3c24e979c5ff5618f7e49768 Mon Sep 17 00:00:00 2001 From: naiba Date: Mon, 2 May 2022 13:36:49 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=96=20`dashboard=20v0.13.9`=20ignore?= =?UTF-8?q?=20monitor=20unmarshal=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- model/monitor.go | 6 ++++-- service/singleton/servicesentinel.go | 2 +- service/singleton/singleton.go | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 0859179..10c38bb 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@
LOGO designed by 熊大 .

-    +   

:trollface: Nezha Monitoring self-hosted lightweight monitoring and operation and maintenance system. Supports system status, HTTP (SSL certificate change, upcoming expiration, expiration), TCP, Ping monitoring and alerting, execute scheduled tasks and web terminal.

diff --git a/model/monitor.go b/model/monitor.go index 0230eeb..5eadc12 100644 --- a/model/monitor.go +++ b/model/monitor.go @@ -2,6 +2,7 @@ package model import ( "fmt" + "log" "github.com/naiba/nezha/pkg/utils" pb "github.com/naiba/nezha/proto" @@ -69,11 +70,12 @@ func (m *Monitor) CronSpec() string { } func (m *Monitor) AfterFind(tx *gorm.DB) error { + m.SkipServers = make(map[uint64]bool) var skipServers []uint64 if err := utils.Json.Unmarshal([]byte(m.SkipServersRaw), &skipServers); err != nil { - return err + log.Println("NEZHA>> Monitor.AfterFind:", err) + return nil } - m.SkipServers = make(map[uint64]bool) for i := 0; i < len(skipServers); i++ { m.SkipServers[skipServers[i]] = true } diff --git a/service/singleton/servicesentinel.go b/service/singleton/servicesentinel.go index 1877de5..d4612aa 100644 --- a/service/singleton/servicesentinel.go +++ b/service/singleton/servicesentinel.go @@ -162,7 +162,7 @@ func (ss *ServiceSentinel) loadMonitorHistory() { var monitors []*model.Monitor err := DB.Find(&monitors).Error if err != nil { - return + panic(err) } ss.serviceResponseDataStoreLock.Lock() diff --git a/service/singleton/singleton.go b/service/singleton/singleton.go index f9c6437..b551232 100644 --- a/service/singleton/singleton.go +++ b/service/singleton/singleton.go @@ -12,7 +12,7 @@ import ( "github.com/naiba/nezha/pkg/utils" ) -var Version = "v0.13.8" // !!记得修改 README 中的 badge 版本!! +var Version = "v0.13.9" // !!记得修改 README 中的 badge 版本!! var ( Conf *model.Config