mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-11-04 16:40:21 +00:00
⚡️ 流量记录清理
This commit is contained in:
1 parent
f7e9ea72dd
commit
21d3dc95d4
3 files changed
+7
-3
No files matched your search
@@ -120,7 +120,11 @@ func cleanMonitorHistory() {
|
||||
for id, couldRemove := range specialServerKeep {
|
||||
dao.DB.Unscoped().Delete(&model.Transfer{}, "id = ? AND created_at < ?", id, couldRemove)
|
||||
}
|
||||
dao.DB.Unscoped().Delete(&model.Transfer{}, "id NOT IN (?) AND created_at < ?", specialServerIDs, allServerKeep)
|
||||
if allServerKeep.IsZero() {
|
||||
dao.DB.Unscoped().Delete(&model.Transfer{}, "id NOT IN (?)", specialServerIDs)
|
||||
} else {
|
||||
dao.DB.Unscoped().Delete(&model.Transfer{}, "id NOT IN (?) AND created_at < ?", specialServerIDs, allServerKeep)
|
||||
}
|
||||
}
|
||||
|
||||
func loadServers() {
|
||||
|
||||
Reference in new issue
Block a user