Skip to main content

update_cache

Function update_cache 

Source
pub async fn update_cache(
    pool: &Pool<Sqlite>,
    subject_did: &str,
    current_count: u32,
    now: SystemTime,
) -> Result<()>
Expand description

UPSERT a recompute result into the cache. Bumps current_strike_count and last_recompute_at; leaves last_action_at untouched on the conflict-update path (this is a recompute, not a new action). On the insert path last_action_at is NULL — the conflict-update branch should be the only realistic path since the recorder writes the row on every action; a fresh-INSERT here would only happen if the caller invokes this on a never-actioned subject (which the public surface forbids via get_or_recompute_strike_count’s missing-cache check).