Skip to main content

reap_one

async fn reap_one(
    conn: &mut PgConnection,
    file_store: &dyn FileStore,
    upload: &ReapableUpload,
) -> Result<bool>
Expand description

Retires the record, removes the object, and only then soft-deletes the file_uploads row. Ok(false) means a save came to declare the file after get_reapable listed it, so it is no longer reapable.

Deleting the file_uploads row last is what makes a failed object delete recoverable: get_reapable still sees the row and retries it on a later run, instead of orphaning the object forever.