Serve stale virtual members while they refresh (#167)

Virtual merges expire after 60s and the next request blocks on every member. One slow member (a large github_rpm remote) makes the re-merge outlast dnf's 30s timeout.

- add `serve_stale` to remotes (model, v2 API, migration 0008, UI, TUI), default false
- serve a flagged member's last good fetch to rpm/deb/alpine merges at once
- refresh it in the background, single-flighted, detached from the request
- block on the member again once its copy is over an hour old, or the flag is off
- prune copies with their merge cache; drop refreshes for evicted entries

Reviewed-on: #167
Co-authored-by: unkin-agent <unkin-agent@unkin.net>
Co-committed-by: unkin-agent <unkin-agent@unkin.net>
This commit was merged in pull request #167.
This commit is contained in:
2026-10-25 15:44:16 +11:00
committed by BenVincent
parent f0ee593164
commit e5313342ba
10 changed files with 459 additions and 11 deletions
+3
View File
@@ -73,6 +73,9 @@ type Remote struct {
QuarantineDays int `json:"quarantine_days,omitempty"`
StaleOnError bool `json:"stale_on_error"`
// ServeStale lets an rpm/deb/alpine virtual merge this member's previous
// index while it refreshes in the background.
ServeStale bool `json:"serve_stale"`
ReleasesRemote string `json:"releases_remote,omitempty"`
ManagedBy string `json:"managed_by,omitempty"`