Skip to main content

sweep_old_transcripts

Function sweep_old_transcripts 

Source
pub fn sweep_old_transcripts(dir: &Path, max_files: usize) -> Result<usize>
Expand description

Delete the oldest .jsonl files in dir when the count exceeds max_files.

Files are sorted by modification time (oldest first). Returns the number of files deleted.

ยงErrors

Returns io::Error if the directory cannot be read or a file cannot be deleted.