fix(traffic): keep lifecycle statements under SQLite's variable limit

Three statement shapes bound one SQL variable per row and failed past
SQLite's limit, which a node can reach by itself with the clients and
inbounds it reports: the depleted-client lookup and disable in
disableInvalidClients (stopping every expiry and quota check), the
whole-slice Saves of renewed inbounds and traffics (stopping renewals),
and Preload("ClientStats") over all inbounds (stopping config builds).
The IN lists are chunked, the Saves go 100 rows at a time, and client
stats are attached in chunks instead of preloaded.
This commit is contained in:
MHSanaei
2026-10-31 10:34:35 +01:00
parent fd3fa86982
commit 8ca321138b
6 changed files with 145 additions and 13 deletions
+1 -1
View File
@@ -196,7 +196,7 @@ func (s *InboundService) MigrationRequirements() (err error) {
return
}
}
if err = tx.Save(inbounds).Error; err != nil {
if err = saveInChunks(tx, inbounds); err != nil {
return
}