Repository navigation
feat(api): add endpoint to refresh the redirects cache - #132
Merged
Merged
Conversation
BojanG99
force-pushed
the
bojangalic/updateCacheRoutine
branch
from
October 3, 2026 16:09
4f943fc to
614683d
Compare
n-dusan
reviewed
Oct 5, 2026
Contributor
There was a problem hiding this comment.
suggestion: would moving code to an api/internal/redirects be more consistent?
n-dusan
approved these changes
Oct 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description (e.g. "Related to ...", etc.)
taf-server updateinserts new redirects into the database, but therunning server only computes its in-memory map of repos-with-redirects
once at startup, so newly inserted redirects were invisible until a
restart.
Add
POST /_internal/redirects/refresh, which re-queries the databaseand replaces the cached set. The cache now lives behind an
Arc<RwLock<_>>so a refresh in one Actix worker/scope is visible toall of them, instead of each clone of
Appholding its own copy.The endpoint has no guard; external access is expected to be blocked
at the nginx layer (see openlawlibrary/publish-server).
Code review checklist (for code reviewer to complete)
Automated tests, benchmarks and linters
You can run the tests, lints and benchmarks that are run on CI locally with: