mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-25 12:04:44 +03:00
perf(traffic): find globally depleted clients with one set query (#7021)
On a node that a master pushes cross-panel usage to, the 5-second traffic job looked up client_global_traffics once per enabled client to decide who to disable, and its freshness probe counted every fresh row (#7008). The scan of all enabled clients now builds the over-quota ids once and matches them with IN, and the probe is an EXISTS that stops at the first fresh row. Who gets disabled is unchanged: same 24-hour window, one master must reach the quota, masters are never summed. The email-scoped callers keep the correlated predicate. The Postgres job runs the four semantic tests.
This commit is contained in:
@@ -114,6 +114,16 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: PostgreSQL depletion query regressions
|
||||
run: |
|
||||
set -o pipefail
|
||||
go test ./internal/web/service -run '^TestDepletionQuery(Semantics|FreshnessAndReset|ConcurrentCommit|Renewals)$' -count=1 -v | tee /tmp/postgres-depletion-query.log
|
||||
passed=$(grep -c -- '^--- PASS' /tmp/postgres-depletion-query.log || true)
|
||||
if [ "$passed" -ne 4 ]; then
|
||||
echo "expected 4 passing PostgreSQL depletion tests, got $passed" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: PostgreSQL deferred-commit test
|
||||
run: |
|
||||
set -o pipefail
|
||||
|
||||
Reference in New Issue
Block a user