Honour force_refresh on the get_term_info endpoint#56
Merged
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.
What
Wire
force_refreshthrough the/get_term_infoHTTP 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_infoalways served its in-memory L1 cache, and on a miss_run_term_infocalledget_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 byrun_query.This mirrors the existing
handle_run_querypattern:handle_get_term_infonow readsforce_refreshfrom the query string; when true itrcache.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 toget_term_info(..., force_refresh=force_refresh), which recomputes and rewrites the SOLR term_info cache.No behaviour change when
force_refreshis absent/false.Why now
Surfaced while shipping the has_reference References builder (v1.22.4, #55): the corrected
Publicationscould not be made to appear via?force_refresh=truebecause the endpoint dropped the flag.