Skip to main content

prune_sessions

Function prune_sessions 

Source
pub fn prune_sessions(
    root: &Path,
    options: &PruneOptions,
    alive: &dyn Fn(u32) -> bool,
) -> Result<PruneReport, ComputerError>
Expand description

Remove empty session directories and stale ones under root.

A directory with no snapshot or screenshot map is empty and is removed even when its owner pid is alive. A directory that still has content is kept while alive says the owner pid is running. Content whose owner is dead or unknown is removed once it is at least ttl old. alive is injected so tests do not depend on the process table.