remotes: flush cached metadata when a remote's base_url changes #120
Reference in New Issue
Block a user
Delete Branch "benvin/flush-cache-on-remote-update"
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?
Why
Switching a remote's backend (
base_url) left artifactapi serving the previously-cached mutable metadata (repodata / Release / APKINDEX) until TTL expiry, so requests could keep pointing at the old upstream.cache.FlushRemotealready existed but was wired to nothing.How
MetadataFlusher(satisfied by*cache.Redis) intoRemotesHandlerviaNewRemotesHandler;server.gopassess.cache.base_urlchanged, so the next request re-fetches fresh from the new upstream.base_url(upstream identity); a flush failure is logged as a warning and does not fail the request since the DB update already landed.base_urlchange flushes exactly once, an unchangedbase_urldoes not flush, and a flush error still returns 200.