Skip to main content

capture_take

Function capture_take 

Source
pub(crate) fn capture_take(
    dir: &Path,
    take_id: u128,
    take: &TakeRecord<'_>,
    cancel: &CancelToken,
)
Expand description

Write one take into dir/take-<take_id>/ and prune the store to RETAINED_TAKES. Nothing here can fail the caller: every step logs its own failure and stops that take’s capture.

cancel is this take’s token. Its answer is sent before the write starts, so a cancel that lands while the write runs is seen here and nowhere else: the directory this call claimed is removed rather than left to persist and count toward retention. When the removal itself fails, the directory is left in place and the failure is logged.