diff options
author | Alex Auvolat <alex@adnab.me> | 2023-06-13 10:48:22 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-06-13 10:48:22 +0200 |
commit | 942c1f1bfe138cbc4e49540cede852e4d462590e (patch) | |
tree | 1c95238bb519e7f20cd7f749adf864544993e507 /src/api | |
parent | 0a06fda0da35f4018c39bf6aec90e55bdf42d241 (diff) | |
download | garage-942c1f1bfe138cbc4e49540cede852e4d462590e.tar.gz garage-942c1f1bfe138cbc4e49540cede852e4d462590e.zip |
multipart uploads: save timestamp
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/s3/multipart.rs | 5 |
1 files changed, 3 insertions, 2 deletions
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<Response<Body>, 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 |