Skip to main content

stream_exercise_service_upload

Function stream_exercise_service_upload 

Source
pub async fn stream_exercise_service_upload(
    path_prefix: &str,
    payload: Multipart,
    file_store: &dyn FileStore,
    uploaded_paths: &mut Vec<ExerciseServiceUploadCleanup>,
    base_url: &str,
) -> Result<StreamedExerciseServiceUpload, ControllerError>
Expand description

Streams every multipart part to the object store, issuing no statements at all.

Split from the row inserts on purpose: the limits here are byte-based, not time-based, so a handler that opened a transaction first would hold a connection idle in transaction for as long as the client cares to trickle 100 MiB, and enough concurrent slow uploads would exhaust the pool and hold back the vacuum xmin horizon.