From 928d88f13171326c849e0065fd507852b731476b Mon Sep 17 00:00:00 2001 From: somebodywashere <68244480+somebodywashere@users.noreply.github.com> Date: Mon, 19 Jun 2023 13:55:41 +0000 Subject: [PATCH] modified: web/job/check_client_ip_job.go --- web/job/check_client_ip_job.go | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/web/job/check_client_ip_job.go b/web/job/check_client_ip_job.go index 0305fcea..dc71d273 100644 --- a/web/job/check_client_ip_job.go +++ b/web/job/check_client_ip_job.go @@ -32,6 +32,13 @@ func (j *CheckClientIpJob) Run() { logger.Debug("Check Client IP Job...") if hasLimitIp() { + logIpFile, err := os.OpenFile("/var/log/3xipl.log", os.O_CREATE|os.O_APPEND|os.O_RDWR, 0644) + if err != nil { + log.Panic(err) + } + defer logIpFile.Close() + log.SetOutput(logIpFile) + log.SetFlags(log.LstdFlags) processLogFile() } @@ -240,15 +247,6 @@ func updateInboundClientIps(inboundClientIps *model.InboundClientIps, clientEmai shouldCleanLog = true if limitIp < len(ips) && inbound.Enable { - - logIpFile, err := os.Create("/var/log/3xipl.log") - if err != nil { - log.Panic(err) - } - defer logIpFile.Close() - log.SetOutput(logIpFile) - log.SetFlags(log.LstdFlags) - disAllowedIps = append(disAllowedIps, ips[limitIp:]...) for i := limitIp; i < len(ips); i++ { log.Println("[LIMIT_IP] Email=", clientEmail, " SRC=", ips[i])