From 3d5e292d26a1b8915c038e4a3b11a1666a79a0a6 Mon Sep 17 00:00:00 2001 From: Akkia Date: Tue, 12 Apr 2022 00:01:38 +0800 Subject: [PATCH] =?UTF-8?q?optimize:=20=E7=A7=BB=E9=99=A4=E4=B8=A4?= =?UTF-8?q?=E5=A4=84=E5=86=97=E4=BD=99=E7=9A=84=E4=BB=A3=E7=A0=81=20(?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E5=90=8E=E6=9C=AA=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=EF=BD=9C=E9=87=8D=E5=A4=8D=E5=88=9D=E5=A7=8B=E5=8C=96)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/dashboard/main.go | 5 ----- service/singleton/servicesentinel.go | 1 - 2 files changed, 6 deletions(-) diff --git a/cmd/dashboard/main.go b/cmd/dashboard/main.go index fce8654..3bfeb2a 100644 --- a/cmd/dashboard/main.go +++ b/cmd/dashboard/main.go @@ -171,11 +171,6 @@ func loadCrons() { for i := 0; i < len(crons); i++ { cr := crons[i] - crIgnoreMap := make(map[uint64]bool) - for j := 0; j < len(cr.Servers); j++ { - crIgnoreMap[cr.Servers[j]] = true - } - // 注册计划任务 cr.CronJobID, err = singleton.Cron.AddFunc(cr.Scheduler, singleton.CronTrigger(cr)) if err == nil { diff --git a/service/singleton/servicesentinel.go b/service/singleton/servicesentinel.go index 50aa78f..cb897d5 100644 --- a/service/singleton/servicesentinel.go +++ b/service/singleton/servicesentinel.go @@ -149,7 +149,6 @@ func (ss *ServiceSentinel) loadMonitorHistory() { var err error ss.monitorsLock.Lock() defer ss.monitorsLock.Unlock() - ss.monitors = make(map[uint64]*model.Monitor) for i := 0; i < len(monitors); i++ { task := *monitors[i] // 通过cron定时将服务监控任务传递给任务调度管道