mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-11-04 16:40:21 +00:00
improve check for offline rules (#1013)
* improve check for offline rules * bug fixes * update dependencies * fix error wrap * fix offline check * improve readability
This commit is contained in:
1 parent
d2ffe106ac
commit
af55fae652
13 files changed
+198
-167
No files matched your search
@@ -186,7 +186,9 @@ func checkStatus() {
|
||||
}
|
||||
// 清理旧数据
|
||||
if max > 0 && max < len(alertsStore[alert.ID][server.ID]) {
|
||||
alertsStore[alert.ID][server.ID] = alertsStore[alert.ID][server.ID][len(alertsStore[alert.ID][server.ID])-max:]
|
||||
index := len(alertsStore[alert.ID][server.ID]) - max
|
||||
clear(alertsStore[alert.ID][server.ID][:index]) // for GC
|
||||
alertsStore[alert.ID][server.ID] = alertsStore[alert.ID][server.ID][index:]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user