mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-25 20:15:01 +03:00
perf(traffic): skip unchanged client lifecycle writes (#7204)
A full inbound save ran the lifecycle UPDATE on client_traffics for every client of the inbound, even when quota, expiry, renewal settings and the enable flag already matched. On PostgreSQL each of those is a new row version and WAL, on every stream-settings edit of a large inbound. Guard the same UPDATE with a NULL-safe IS DISTINCT FROM over the eight columns it assigns, so the database writes only a row that actually differs and still repairs one that drifted. The PostgreSQL CI job runs the lifecycle suite, including a row-lock check on a second connection. Closes #7202
This commit is contained in:
@@ -84,6 +84,15 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: PostgreSQL client traffic lifecycle edits
|
||||
run: |
|
||||
set -o pipefail
|
||||
go test ./internal/web/service -run '^TestClientTrafficLifecyclePostgres$' -count=1 -v | tee /tmp/postgres-client-traffic-lifecycle.log
|
||||
if ! grep -q -- '^--- PASS: TestClientTrafficLifecyclePostgres ' /tmp/postgres-client-traffic-lifecycle.log; then
|
||||
echo "expected the PostgreSQL client traffic lifecycle suite to pass" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: PostgreSQL batched stats identities
|
||||
run: |
|
||||
set -o pipefail
|
||||
|
||||
Reference in New Issue
Block a user