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{}
shouldCleanLog := false
for clientEmail, ips := range InboundClientIps {
inboundClientIps, err := GetInboundClientIps(clientEmail)
@ -93,17 +94,17 @@ func processLogFile() {
addInboundClientIps(clientEmail, ips)
} else {
shouldCleanLog := updateInboundClientIps(inboundClientIps, clientEmail, ips)
shouldCleanLog = updateInboundClientIps(inboundClientIps, clientEmail, ips)
}
}
if shouldCleanLog {
// clean log
if err := os.Truncate(GetAccessLogPath(), 0); err != nil {
checkError(err)
}
}
}
}
time.Sleep(10 * time.Second)
}