From 35feef650f793ffbec2af51a18fd25d8b0beefb1 Mon Sep 17 00:00:00 2001 From: Alireza Ahmadi Date: Fri, 8 Dec 2023 20:08:44 +0100 Subject: import-export inbound #1300 --- web/service/inbound.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'web/service') 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 -- cgit v1.2.3