From beacad316857a8267a1cff13f2a042c87dfb357e Mon Sep 17 00:00:00 2001 From: Hossin Asaadi Date: Sun, 30 Oct 2022 14:24:33 -0400 Subject: [PATCH] remove merging new ips and old ones in ip log --- web/job/check_clinet_ip_job.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/web/job/check_clinet_ip_job.go b/web/job/check_clinet_ip_job.go index 7e1cc4f7..4e1d17fb 100644 --- a/web/job/check_clinet_ip_job.go +++ b/web/job/check_clinet_ip_job.go @@ -179,11 +179,7 @@ func addInboundClientIps(clientEmail string,ips []string) error { } func updateInboundClientIps(inboundClientIps *model.InboundClientIps,clientEmail string,ips []string) error { - var oldIps []string - err := json.Unmarshal([]byte(inboundClientIps.Ips), &oldIps) - mergedIps := Unique(append(oldIps, ips...)) - - jsonIps, err := json.Marshal(mergedIps) + jsonIps, err := json.Marshal(ips) checkError(err) inboundClientIps.ClientEmail = clientEmail @@ -199,7 +195,7 @@ func updateInboundClientIps(inboundClientIps *model.InboundClientIps,clientEmail limitIp, err := strconv.Atoi(limitIpMactch) - if(limitIp < len(mergedIps) && limitIp != 0 && inbound.Enable) { + if(limitIp < len(ips) && limitIp != 0 && inbound.Enable) { DisableInbound(inbound.Id) }