Feat/acronym search 02 redis cache - #5
Open
borkarsaish65 wants to merge 3 commits into
Open
Conversation
Adds Alembic with a no-op baseline revision for the pre-existing unmanaged translations table, plus a migration that creates acronym_mapping (id PK, expansions as JSONB array, description, composite index on acronym+is_active) and seeds it from data/acronyms.csv, now the real 599-acronym dataset.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
get_expansion() checks Redis first, falls back to Postgres on miss, writes through to cache; warm_cache() pre-populates every active acronym at startup. Redis pieces (cache_client.py, redis_client.py) stay acronym-agnostic; only acronym_service.py knows about acronyms, JSON-encoding the expansions array for the string-only cache layer.
borkarsaish65
force-pushed
the
feat/acronym-search-02-redis-cache
branch
from
August 14, 2026 07:36
57ea05e to
f160cd7
Compare
get_expansion() only handled a cache miss (Redis says "not found"), not a cache error (Redis unreachable/timing out) — the latter raised straight out of the function before Postgres was ever tried, so a Redis outage broke every acronym-detected search instead of just degrading it. Now both the cache read and the write-through are guarded: any Redis error logs a warning and falls back to Postgres, matching the fallback behavior main.py's startup path already assumes exists.
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.
No description provided.