Skip to main content

refresh_report_scope

Function refresh_report_scope 

Source
pub fn refresh_report_scope(
    corpus_name: String,
    service_name: String,
    session: Option<AdminSession>,
    pool: &State<DbPool>,
) -> Result<Status, Status>
Expand description

Report-footer “Refresh this report”: drop the cached report grains for this (corpus, service) scope so the next view recomputes them from current data. Scoped (not the global all-corpora bust refresh_reports does) and synchronous — busting report_grain_cache is an instant keyed DELETE, so there is no background job to poll; the caller just reloads. Gated by the signed-in AdminSession cookie (the footer shows the button only to admins; a missing session is a clean 401 for the XHR rather than an HTML redirect). 404 on an unknown corpus/service, 204 on success. Agent twin: refresh_report_scope_api.