Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlireza Ahmadi <alireza7@gmail.com>2023-12-08 22:08:44 +0300
committerAlireza Ahmadi <alireza7@gmail.com>2023-12-08 22:08:44 +0300
commit35feef650f793ffbec2af51a18fd25d8b0beefb1 (patch)
treef36cac6a4c188118418b53f45c681e7a4e821e6d /web/service
parent38013e5ea942f35d7f187b476c2f8914281b6c18 (diff)
import-export inbound #1300
Diffstat (limited to 'web/service')
-rw-r--r--web/service/inbound.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/web/service/inbound.go b/web/service/inbound.go
index 73dd17e5..01d4eb57 100644
--- a/web/service/inbound.go
+++ b/web/service/inbound.go
@@ -168,9 +168,13 @@ func (s *InboundService) AddInbound(inbound *model.Inbound) (*model.Inbound, boo
err = tx.Save(inbound).Error
if err == nil {
- for _, client := range clients {
- s.AddClientStat(tx, inbound.Id, &client)
+ if len(inbound.ClientStats) == 0 {
+ for _, client := range clients {
+ s.AddClientStat(tx, inbound.Id, &client)
+ }
}
+ } else {
+ return inbound, false, err
}
needRestart := false