This commit is contained in:
somebodywashere 2023-06-08 19:38:14 +00:00
parent f84897e4fb
commit 29d854eae7

View file

@ -85,6 +85,7 @@ func processLogFile() {
} }
disAllowedIps = []string{} disAllowedIps = []string{}
shouldCleanLog := false
for clientEmail, ips := range InboundClientIps { for clientEmail, ips := range InboundClientIps {
inboundClientIps, err := GetInboundClientIps(clientEmail) inboundClientIps, err := GetInboundClientIps(clientEmail)
@ -93,17 +94,17 @@ func processLogFile() {
addInboundClientIps(clientEmail, ips) addInboundClientIps(clientEmail, ips)
} else { } else {
shouldCleanLog := updateInboundClientIps(inboundClientIps, clientEmail, ips) shouldCleanLog = updateInboundClientIps(inboundClientIps, clientEmail, ips)
}
}
if shouldCleanLog { if shouldCleanLog {
// clean log // clean log
if err := os.Truncate(GetAccessLogPath(), 0); err != nil { if err := os.Truncate(GetAccessLogPath(), 0); err != nil {
checkError(err) checkError(err)
} }
} }
}
}
time.Sleep(10 * time.Second) time.Sleep(10 * time.Second)
} }