Skip to main content

sweep_orphaned_uploads

Function sweep_orphaned_uploads 

Source
pub fn sweep_orphaned_uploads(root: &FsRoot, audit: &AuditSink) -> usize
Expand description

Remove .part staging files left behind by a previous run, recording a terminal event for each.

Thin wrapper over crate::fs::sweep_orphan_parts: that function stays audit-agnostic (it lives in crate::fs, which has no AuditSink), and this is where the recording happens instead — same split as sweep_expired_uploads over UploadStore::sweep.

The recorded upload.orphaned event carries upload_id but not file: the destination lived only in the in-memory session a restart already discarded before this ever runs, so there is nothing left to attach as file. It also carries neither route nor identity, for the same reason upload.expired does not — nothing here was driven by a request. A reader correlates an orphan back to the upload.start that does have the destination by matching upload_id between the two events.