Files
mirror-3x-ui/internal
Hamed b13c6d9be9 perf(clients): persist reconciled timestamps in one write (#7242)
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
2026-11-29 17:17:36 +03:30
..
2026-10-25 20:08:14 +01:00