diff options
| author | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-04-25 18:06:06 +0300 |
|---|---|---|
| committer | MHSanaei <ho3ein.sanaei@gmail.com> | 2023-04-25 18:06:06 +0300 |
| commit | bc06dbab21df01ede095d850a41ac769ae582469 (patch) | |
| tree | fbd32ac8047a8cb682502c54c17415db8f117a15 /web/service | |
| parent | 6a71ea7f5e66fe147bad4b6df1f37d10cc632c0c (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.go | 13 |
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) } |
