From 942c1f1bfe138cbc4e49540cede852e4d462590e Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Tue, 13 Jun 2023 10:48:22 +0200 Subject: multipart uploads: save timestamp --- src/api/s3/multipart.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/api/s3/multipart.rs') diff --git a/src/api/s3/multipart.rs b/src/api/s3/multipart.rs index 7df0dafc..52ea8e78 100644 --- a/src/api/s3/multipart.rs +++ b/src/api/s3/multipart.rs @@ -33,12 +33,13 @@ pub async fn handle_create_multipart_upload( key: &str, ) -> Result, Error> { let upload_id = gen_uuid(); + let timestamp = now_msec(); let headers = get_headers(req.headers())?; // Create object in object table let object_version = ObjectVersion { uuid: upload_id, - timestamp: now_msec(), + timestamp, state: ObjectVersionState::Uploading { multipart: true, headers, @@ -50,7 +51,7 @@ pub async fn handle_create_multipart_upload( // Create multipart upload in mpu table // This multipart upload will hold references to uploaded parts // (which are entries in the Version table) - let mpu = MultipartUpload::new(upload_id, bucket_id, key.into(), false); + let mpu = MultipartUpload::new(upload_id, timestamp, bucket_id, key.into(), false); garage.mpu_table.insert(&mpu).await?; // Send success response -- cgit v1.2.3