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:
authorMHSanaei <ho3ein.sanaei@gmail.com>2023-04-25 18:06:06 +0300
committerMHSanaei <ho3ein.sanaei@gmail.com>2023-04-25 18:06:06 +0300
commitbc06dbab21df01ede095d850a41ac769ae582469 (patch)
treefbd32ac8047a8cb682502c54c17415db8f117a15 /web/service
parent6a71ea7f5e66fe147bad4b6df1f37d10cc632c0c (diff)
[migration] add fix for omitted traffics
Co-Authored-By: Alireza Ahmadi <alireza7@gmail.com>
Diffstat (limited to 'web/service')
-rw-r--r--web/service/inbound.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/web/service/inbound.go b/web/service/inbound.go
index 0245ffa7..ab2ceb66 100644
--- a/web/service/inbound.go
+++ b/web/service/inbound.go
@@ -868,6 +868,19 @@ func (s *InboundService) MigrationRequirements() {
inbounds[inbound_index].Settings = string(modifiedSettings)
}
+ modelClients, err := s.getClients(inbounds[inbound_index])
+ if err != nil {
+ return
+ }
+ for _, modelClient := range modelClients {
+ if len(modelClient.Email) > 0 {
+ var count int64
+ db.Model(xray.ClientTraffic{}).Where("email = ?", modelClient.Email).Count(&count)
+ if count == 0 {
+ s.AddClientStat(inbounds[inbound_index].Id, &modelClient)
+ }
+ }
+ }
}
db.Save(inbounds)
}