Skip to content

Commit e3f6b77

Browse files
committed
Update.
1 parent 8cccfbd commit e3f6b77

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

cmd/dashboard/controller/common_page.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,8 +1183,7 @@ func (cp *commonPage) ws(c *gin.Context) {
11831183
if singleton.Conf.Debug {
11841184
log.Printf("NG-ERROR: failed to get server stat for websocket: %v", err)
11851185
}
1186-
// 发生错误时等待一下再继续,避免快速重试
1187-
time.Sleep(time.Second)
1186+
// 不要退出,让 done channel 处理终止
11881187
continue
11891188
}
11901189
if err = safeConn.WriteMessage(websocket.TextMessage, stat); err != nil {

cmd/dashboard/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ func main() {
199199
if err := graceful.Graceful(func() error {
200200
return srv.ListenAndServe()
201201
}, func(c context.Context) error {
202-
log.Println("NG-ERROR Graceful::START")
202+
log.Println("开始优雅关闭服务...")
203203

204204
// 取消所有后台任务
205205
cancel()

service/singleton/alertsentinel.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ func AlertSentinelStart() {
176176

177177
if lastPrint.Before(startedAt.Add(-1 * time.Hour)) {
178178
if Conf.Debug {
179-
log.Println("NG-ERROR 报警规则检测每小时", checkCount, "次", startedAt, time.Now())
179+
log.Println("报警规则检测统计:每小时", checkCount, "次", startedAt, time.Now())
180180
}
181181
checkCount = 0
182182
lastPrint = startedAt

service/singleton/notification.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ func SendNotification(notificationTag string, desc string, muteLabel *string, ex
180180

181181
if !flag {
182182
if Conf.Debug {
183-
log.Println("NG-ERROR 静音的重复通知(3小时内):", desc, muteLabel)
183+
log.Println("静音的重复通知(3小时内):", desc, muteLabel)
184184
}
185185
return
186186
}
@@ -190,15 +190,15 @@ func SendNotification(notificationTag string, desc string, muteLabel *string, ex
190190
defer notificationsLock.RUnlock()
191191

192192
// 调试信息:显示通知方式组和可用的通知方式
193-
log.Printf("NG-ERROR 尝试发送通知到组 [%s],消息:%s", notificationTag, desc)
193+
log.Printf("尝试发送通知到组 [%s],消息:%s", notificationTag, desc)
194194
if NotificationList[notificationTag] == nil {
195195
log.Printf("NG-ERROR 警告:通知方式组 [%s] 不存在", notificationTag)
196196
return
197197
}
198-
log.Printf("NG-ERROR 通知方式组 [%s] 包含 %d 个通知方式", notificationTag, len(NotificationList[notificationTag]))
198+
log.Printf("通知方式组 [%s] 包含 %d 个通知方式", notificationTag, len(NotificationList[notificationTag]))
199199

200200
for _, n := range NotificationList[notificationTag] {
201-
log.Println("NG-ERROR 尝试通知", n.Name)
201+
log.Println("尝试通知", n.Name)
202202
}
203203
for _, n := range NotificationList[notificationTag] {
204204
ns := model.NotificationServerBundle{
@@ -212,7 +212,7 @@ func SendNotification(notificationTag string, desc string, muteLabel *string, ex
212212
if err := ns.Send(desc); err != nil {
213213
log.Println("NG-ERROR 向 ", n.Name, " 发送通知失败:", err)
214214
} else {
215-
log.Println("NG-ERROR 向 ", n.Name, " 发送通知成功")
215+
log.Println("向 ", n.Name, " 发送通知成功")
216216
}
217217
}
218218
}

0 commit comments

Comments
 (0)