mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-29 22:14:50 +03:00
b13c6d9be9
Reconciling a client record whose fields changed wrote it twice: Save stamped updated_at with the current time, then a second UPDATE put the agreed timestamp back. A PostgreSQL master with about 7,000 clients counted roughly 179,000 of each in 50 minutes. Run the Save through a session whose clock returns the agreed timestamp, so GORM's hooks and serializers still run and one UPDATE carries the right value. An unchanged row still writes nothing. Verified on SQLite and PostgreSQL 18: one UPDATE per changed row, where the previous code issues two. Fixes #7234