object lifecycles (fix #309) #620
1 changed files with 16 additions and 5 deletions
|
@ -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
|
_ => {
|
||||||
.bucket_table
|
match garage
|
||||||
.get(&EmptyKey, &object.bucket_id)
|
.bucket_table
|
||||||
.await?
|
.get(&EmptyKey, &object.bucket_id)
|
||||||
.ok_or_message("object in non-existent bucket")?,
|
.await?
|
||||||
|
{
|
||||||
|
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
|
||||||
|
|
Loading…
Reference in a new issue