Skip to main content

archive_memory

Function archive_memory 

Source
pub fn archive_memory(
    conn: &Connection,
    id: &str,
    reason: Option<&str>,
) -> Result<bool>
Expand description

Move a memory from memories to archived_memories. Used by the HTTP /api/v1/archive explicit-archive endpoint (S29) and by sync_push when a peer pushes an archives: [id] record.

Unlike gc(archive=true) this does not filter on expires_at — the caller is explicitly asking for the row to be archived right now.

Returns true if a row was moved, false if no live memory existed with this id (e.g. it was already archived or never written locally). A missing-on-peer id is expected during normal fanout and callers treat it as a no-op.

§Errors

Returns an error if the INSERT-SELECT or DELETE fails.