mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-03-22 11:01:52 +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:
@@ -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