Skip to content

Honour force_refresh on the get_term_info endpoint#56

Merged
Robbie1977 merged 2 commits into
mainfrom
feature/term-info-force-refresh
Jun 27, 2026
Merged

Honour force_refresh on the get_term_info endpoint#56
Robbie1977 merged 2 commits into
mainfrom
feature/term-info-force-refresh

Conversation

@Robbie1977

Copy link
Copy Markdown
Contributor

What

Wire force_refresh through the /get_term_info HTTP endpoint so a stale term_info entry can actually be busted on demand.

Previously the get_term_info endpoint ignored force_refresh: handle_get_term_info always served its in-memory L1 cache, and on a miss _run_term_info called get_term_info(short_form) with no refresh — so the underlying @with_solr_cache('term_info') entry (possibly computed by an older release) kept being served. The flag was only honoured by run_query.

This mirrors the existing handle_run_query pattern:

  • handle_get_term_info now reads force_refresh from the query string; when true it rcache.invalidate(key) (skips the L1 read and drops the stale entry) and propagates the flag to the worker.
  • _run_term_info(short_form, force_refresh=False) forwards it to get_term_info(..., force_refresh=force_refresh), which recomputes and rewrites the SOLR term_info cache.

No behaviour change when force_refresh is absent/false.

Why now

Surfaced while shipping the has_reference References builder (v1.22.4, #55): the corrected Publications could not be made to appear via ?force_refresh=true because the endpoint dropped the flag.

@Robbie1977 Robbie1977 merged commit c8123e8 into main Jun 27, 2026
0 of 4 checks passed
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