Skip to content

feat(eda): add clear_cache option to /eda endpoint#233

Open
mrmaloof wants to merge 1 commit into
developfrom
feature/eda_cache_clear
Open

feat(eda): add clear_cache option to /eda endpoint#233
mrmaloof wants to merge 1 commit into
developfrom
feature/eda_cache_clear

Conversation

@mrmaloof
Copy link
Copy Markdown
Collaborator

@mrmaloof mrmaloof commented May 11, 2026

Adds support for ?clear-cache=1 on GET /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

  • Optional query parameter clear-cache (URL query only; path and response shape unchanged).
  • If clear-cache equals "1", EDA_CACHE.pop(cache_key, None) runs after the batch is validated and before the normal cache get/set flow.
  • Query is declared as Annotated[..., Query(alias="clear-cache")] = None so the default lives only on the parameter, matching FastAPI’s rules for Annotated + 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.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant