mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-18 09:10:57 +00:00
fix(client): persist a bulk adjustment's applied field even when the sibling field is skipped
In a mixed BulkAdjust (both a days delta and a bytes delta), a per-field planning skip such as "unlimited expiry" or "unlimited traffic" was recorded in the same map that gated the client_traffics write. The applied field was already written to the inbound JSON and the clients table, but the enforcement row was left untouched, so the depletion job cut the client on the old limit while the panel showed the new one. Gate the traffic-row write on an actual inbound-processing failure rather than on any planning-phase skip note.
This commit is contained in:
@@ -409,6 +409,7 @@ func (s *ClientService) BulkAdjust(inboundSvc *InboundService, emails []string,
|
||||
needRestart := false
|
||||
flowHonored := map[string]bool{}
|
||||
flowIneligible := map[string]bool{}
|
||||
execFailed := map[string]bool{}
|
||||
for inboundId, ibEmails := range emailsByInbound {
|
||||
ibRes := s.bulkAdjustInboundClients(inboundSvc, inboundId, ibEmails, plan, flow)
|
||||
if ibRes.needRestart {
|
||||
@@ -421,6 +422,7 @@ func (s *ClientService) BulkAdjust(inboundSvc *InboundService, emails []string,
|
||||
flowIneligible[email] = true
|
||||
}
|
||||
for email, reason := range ibRes.perEmailSkipped {
|
||||
execFailed[email] = true
|
||||
if _, already := skippedReasons[email]; !already {
|
||||
skippedReasons[email] = reason
|
||||
}
|
||||
@@ -450,7 +452,7 @@ func (s *ClientService) BulkAdjust(inboundSvc *InboundService, emails []string,
|
||||
|
||||
adjusted := map[string]struct{}{}
|
||||
for email, entry := range plan {
|
||||
if _, skipped := skippedReasons[email]; skipped {
|
||||
if execFailed[email] {
|
||||
continue
|
||||
}
|
||||
updates := map[string]any{}
|
||||
|
||||
Reference in New Issue
Block a user