Skip to main content

refresh_report_scope_api

Function refresh_report_scope_api 

Source
pub fn refresh_report_scope_api(
    corpus: &str,
    service: &str,
    actor: Actor,
    pool: &State<DbPool>,
) -> Result<Json<ScopeRefreshAckDto>, Status>
Expand description

Busts this (corpus, service)’s cached report grains — the agent twin of the report footer’s “Refresh this report” action (refresh_report_scope) — so its reports recompute from current data on the next view (a heavy slice recomputes off the request path; see crate::frontend::concerns::serve_report). Scoped, unlike the global bust refresh_reports does. The bust is an instant keyed DELETE, so this returns 200 OK immediately — there is no background job to poll. Token-gated via the Actor guard (X-Cortex-Token header or ?token=); 401 without a valid token, 404 on an unknown corpus/service.