Files
mirror-3x-ui/.github
Hamed ed44254b0a perf(clients): bound orphan cleanup during inbound adds (#7228)
Adding one client checked every client already on the inbound against the clients table, 400 emails per query, so a 100,000-client inbound paid about 250 lookups per add. Each add now checks one rotating window of at most 400 existing entries; stale entries outside it are removed when the cursor reaches them or when a delete on that inbound runs its full sweep.

The check now runs inside the serialized writer, so a client that another writer recreated while the add was waiting is no longer swept from the inbound. When an add on a node-hosted inbound also prunes stale entries, the node is left to be reconciled instead of being marked as already matching, since it only received the new client.

Reading and rewriting the settings JSON still scales with the inbound: on SQLite with 50,000 clients a single add went from about 512 ms to 465 ms.

Closes #7217
2026-11-28 05:16:42 +03:30
..