Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

Commit

Permalink
fix add traffic bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hossinasaadi committed Nov 15, 2022
1 parent 3e43aaa commit 2c5f63e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions web/service/inbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"x-ui/database/model"
"x-ui/util/common"
"x-ui/xray"
"x-ui/logger"

"gorm.io/gorm"
)
Expand Down Expand Up @@ -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{}
Expand All @@ -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
}

}
Expand Down

0 comments on commit 2c5f63e

Please sign in to comment.