mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
⚡️ 流量记录清理
This commit is contained in:
@@ -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