mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-07-04 11:54:24 +00:00
c0d17e132d
processObserved paid four round-trips per observed email every 10s scan: an inbound-resolving join, a tracking-row read, an autocommit Save (one fsync each under synchronous=FULL), and — worst of all — a full JSON parse of the owning inbound's settings blob just to read that one client's limitIp. On a big single inbound that parse alone made a scan cost ~1.5s per online client. The scan now front-loads three chunked batch queries (clients.limit_ip, email->inbound through the client_inbounds relation keeping the lowest inbound id like the old First(), and the tracking rows) and writes every inbound_client_ips change inside one transaction, so M observed emails cost a handful of queries and a single fsync. The per-email LIKE fallback remains for emails missing from the relation, preserving the #4963 stale-email cleanup. limitIp now comes from the clients table (same source B3 gates on) instead of the settings blob, and xray disconnects for banned clients run after the commit so their network round-trips never extend the write transaction node syncs contend with.