mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-10-24 06:45:01 +03:00
9f0f2b3802
Inbound and traffic writes are serialised on one goroutine because the traffic poll locks inbounds then client_traffics while an admin mutation does the reverse, which Postgres aborts as a deadlock (40P01). Deleting an inbound and purging depleted clients still opened their own transactions, so they could deadlock the poll, and a delete committing between a concurrent edit's read and its Save let GORM's Save fall back to CREATE and resurrect the inbound. Both now go through runSerializedTx like every other inbound write.