fix(inbounds): apply runtime changes after the DB commit (#5768)

* fix(inbounds): apply runtime changes after commit

* ci: fix staticcheck findings
This commit is contained in:
n0ctal authored and GitHub committed 2026-07-08 22:12:28 +02:00 Unverified
1 parent f4199353da
commit f431e9cc03
9 files changed
+420 -195

No files matched your search

+33
View File
@@ -37,6 +37,39 @@ jobs:
go list ./... | grep -v '/frontend/node_modules/' > /tmp/go-packages.txt
go test -shuffle=on -count=1 $(cat /tmp/go-packages.txt)
postgres-durable-first:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: xui_durable
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U postgres -d xui_durable"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Stub internal/web/dist for go:embed
run: mkdir -p internal/web/dist && touch internal/web/dist/.gitkeep
- name: PostgreSQL durable-first tests
run: |
set -o pipefail
XUI_DB_TYPE=postgres XUI_DB_DSN="host=127.0.0.1 port=5432 user=postgres password=postgres dbname=xui_durable sslmode=disable" \
go test ./internal/web/service -run 'PostgresCommitFailure' -count=1 -v | tee /tmp/postgres-durable-first.log
if grep -q -- '--- SKIP' /tmp/postgres-durable-first.log; then
exit 1
fi
codegen:
runs-on: ubuntu-latest
steps:
+4 -5
View File
@@ -52,11 +52,10 @@ func InitLogger(level logging.Level) {
backends := make([]logging.Backend, 0, 2)
// Console/syslog backend with configurable level
if consoleBackend := initDefaultBackend(); consoleBackend != nil {
leveledBackend := logging.AddModuleLevel(consoleBackend)
leveledBackend.SetLevel(level, "x-ui")
backends = append(backends, leveledBackend)
}
consoleBackend := initDefaultBackend()
leveledBackend := logging.AddModuleLevel(consoleBackend)
leveledBackend.SetLevel(level, "x-ui")
backends = append(backends, leveledBackend)
// File backend with DEBUG level for comprehensive logging
if fileBackend := initFileBackend(); fileBackend != nil {
@@ -139,6 +139,7 @@ func TestGetClientTrafficByEmailReadsClientsTable(t *testing.T) {
}
if tr == nil {
t.Fatalf("expected traffic, got nil")
return
}
if tr.UUID != "11111111-1111-1111-1111-111111111111" {
t.Fatalf("UUID not enriched from clients table, got %q", tr.UUID)
Loaded 3 of 9 files, more files were not shown because too many files have changed in this diff. Show more