multipart uploads: save timestamp

This commit is contained in:
Alex Auvolat
2023-06-13 10:48:22 +02:00
parent 0a06fda0da
commit 942c1f1bfe
3 changed files with 20 additions and 5 deletions
+3 -2
View File
@@ -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