feat: ip change notification close #31

This commit is contained in:
naiba
2021-01-13 22:30:28 +08:00
parent c4f6837def
commit 0ce8017875
8 changed files with 35 additions and 9 deletions

View File

@@ -158,7 +158,7 @@ func checkStatus() {
}
if flag {
message := fmt.Sprintf("报警规则:%s服务器%s(%s)%s逮到咯快去看看", alert.Name, server.Name, server.Host.IP, desc)
go sendNotification(message)
go SendNotification(message)
}
}
// 清理旧数据
@@ -169,7 +169,7 @@ func checkStatus() {
}
}
func sendNotification(desc string) {
func SendNotification(desc string) {
notificationsLock.RLock()
defer notificationsLock.RUnlock()
for i := 0; i < len(notifications); i++ {