mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6139] [MERGED] fix(sub): coalesce external subscription refreshes #6102
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#6102
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/6139
Author: @PathGao
Created: 7/29/2026
Status: ✅ Merged
Merged: 7/29/2026
Merged by: @MHSanaei
Base:
main← Head:fix-subscription-cache-refresh📝 Commits (2)
5a4aee4fix(sub): coalesce external subscription refreshes021e9cdfix(sub): preserve shared stale refresh results📊 Changes
2 files changed (+194 additions, -9 deletions)
View changed files
📝
internal/sub/external_subscription.go(+54 -9)📝
internal/sub/external_subscription_test.go(+140 -0)📄 Description
Summary
When a cached external subscription expired, simultaneous client requests each fetched the provider independently. Refreshes are now coalesced per URL; callers share the outcome, including the existing stale-on-error fallback.
The local cache is capped at 256 entries and removes the least recently fetched non-current entry when it fills.
Validation
make verifygo test -race -shuffle=on -count=1 ./internal/sub🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.