object lifecycles (fix #309) #620

Merged
lx merged 25 commits from bucket-lifecycle into next 2023-09-04 09:45:11 +00:00
Showing only changes of commit 1cdc321e28 - Show all commits

View file

@ -249,11 +249,22 @@ async fn process_object(
let bucket = match last_bucket.take() { let bucket = match last_bucket.take() {
Some(b) if b.id == object.bucket_id => b, Some(b) if b.id == object.bucket_id => b,
_ => garage _ => {
match garage
.bucket_table .bucket_table
.get(&EmptyKey, &object.bucket_id) .get(&EmptyKey, &object.bucket_id)
.await? .await?
.ok_or_message("object in non-existent bucket")?, {
Some(b) => b,
None => {
warn!(
"Lifecycle worker: object in non-existent bucket {:?}",
object.bucket_id
);
return Ok(Skip::SkipBucket);
}
}
}
}; };
let lifecycle_policy: &[LifecycleRule] = bucket let lifecycle_policy: &[LifecycleRule] = bucket