From 2c5f63e38646f9dd83096ddcc6a4170efbd3e9a1 Mon Sep 17 00:00:00 2001 From: Hossin Asaadi Date: Tue, 15 Nov 2022 11:54:51 -0500 Subject: [PATCH] fix add traffic bug --- web/service/inbound.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web/service/inbound.go b/web/service/inbound.go index 7dbeb27228..411fe72510 100644 --- a/web/service/inbound.go +++ b/web/service/inbound.go @@ -8,6 +8,7 @@ import ( "x-ui/database/model" "x-ui/util/common" "x-ui/xray" + "x-ui/logger" "gorm.io/gorm" ) @@ -192,7 +193,8 @@ func (s *InboundService) AddClientTraffic(traffics []*xray.ClientTraffic) (err e err := db.Model(model.Inbound{}).Where("settings like ?", "%" + traffic.Email + "%").First(inbound).Error traffic.InboundId = inbound.Id if err != nil { - return err + logger.Warning("AddClientTraffic find model ", err) + continue } // get settings clients settings := map[string][]model.Client{} @@ -214,7 +216,8 @@ func (s *InboundService) AddClientTraffic(traffics []*xray.ClientTraffic) (err e } if err != nil { - return err + logger.Warning("AddClientTraffic update data ", err) + continue } }