feat(eda): add clear_cache option to /eda endpoint#233
Open
mrmaloof wants to merge 1 commit into
Open
Conversation
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.
Adds support for
?clear-cache=1onGET /institutions/{inst_id}/batch/{batch_id}/eda. When present, the handler removes the in-memory TTL cache entry for that institution and batch before resolving the response, so the next response is recomputed from storage instead of returning a cached payload.changes
clear-cache(URL query only; path and response shape unchanged).clear-cacheequals"1",EDA_CACHE.pop(cache_key, None)runs after the batch is validated and before the normal cache get/set flow.Queryis declared asAnnotated[..., Query(alias="clear-cache")] = Noneso the default lives only on the parameter, matching FastAPI’s rules forAnnotated+Query.context
EDA results are cached to avoid repeated reads and heavy computation. Operators and developers sometimes need a forced refresh after data or logic changes without waiting for TTL expiry or restarting the service.