Files
x-ui/web
shayan775 bcea56283f The too many SQL variables path is now batched.
Changed code:

Added safe batching limits in inbound.go:
safeSQLVariablesPerQuery = 900
safeSaveBatchSize = 50
Fixed addClientTraffic in inbound.go:
email IN (...) lookup is now chunked (line 815).
tx.Save(dbClientTraffics) is now chunked (line 859).
Added nil guard for p.SetOnlineClients(...) (line 855).
Hardened adjustTraffics in inbound.go:
deduplicates inbound IDs before querying (line 877).
chunked inbound IN query (line 890).
chunked inbound Save (line 932).
Added regression test:

inbound_add_client_traffic_test.go
Verifies 4,000 client traffic updates succeed and totals are correct.
Validation run:

go test ./web/service -run TestAddClientTrafficHandlesLargeBatch -count=1 passed
go test ./web/service -count=1 passed
2026-02-24 19:19:04 +03:30
..
2026-02-03 20:48:08 +01:00
2025-09-18 23:33:13 +02:00
2025-09-18 22:33:02 +02:00
2026-02-01 00:51:53 +01:00
2026-02-02 16:22:21 +01:00
2024-07-14 03:36:05 +02:00
2023-05-21 06:17:25 +04:30
2025-09-18 22:33:02 +02:00
2026-02-01 00:51:53 +01:00
2026-02-20 00:08:36 +01:00