mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6933] [MERGED] fix(monitoring): refresh cached public IP addresses #6530
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#6530
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6933
Author: @Vaso73
Created: 10/25/2026
Status: ✅ Merged
Merged: 10/25/2026
Merged by: @MHSanaei
Base:
main← Head:fix/public-ip-refresh📝 Commits (3)
4a67ba7fix(monitoring): refresh cached public IP addressesf8cdc96fix(monitoring): back off failed IPv6 lookupsc6084b1Merge branch 'main' into fix/public-ip-refresh📊 Changes
4 files changed (+586 additions, -40 deletions)
View changed files
📝
internal/web/service/server.go(+73 -38)📝
internal/web/service/server_cold_status_test.go(+2 -1)📝
internal/web/service/server_public_ip_async_test.go(+510 -0)📝
internal/web/service/server_scope_test.go(+1 -1)📄 Description
Summary
Refresh the public IPv4/IPv6 addresses shown on Overview after five minutes. Retry failed IPv4 lookups after one minute; consecutive IPv6 failures back off through one, two, five and fifteen minutes, capped at fifteen minutes. Keep the last known address during temporary failures. A successful IPv6 lookup resets its retry delay.
Why
The first lookup is currently cached for the lifetime of the panel process. After the server's external address changes, Overview continues to display the previous address until the panel restarts; an initial failure can also leave
N/Apermanently cached.Status sampling stays nonblocking and concurrent callers share one lookup per service instance. Initial backup filename lookups can wait for the first result; later calls use the cached address while a refresh runs in the background. Existing Overview polling picks up refreshed values without a page reload.
Type of change
Areas affected
How was this tested?
go vet ./...,go build ./..., and CI-pinnedgolangci-lintv2.15.0 with project formatters.Automated application tests use disposable data and loopback-only networking.
Breaking changes
None. No frontend source, API schema, database, configuration or dependency changes.
Checklist
go build ./...and the test suite pass locally.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.