aboutsummaryrefslogtreecommitdiff
path: root/src/model/s3/lifecycle_worker.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-08-30 23:52:09 +0200
committerAlex Auvolat <alex@adnab.me>2023-08-30 23:52:09 +0200
commitb2f679675e3390bea6c6b3b9fb3632d0ed414a75 (patch)
treeaffbb81dd8eeeb1a0ce13bd24ff6d1376dd45024 /src/model/s3/lifecycle_worker.rs
parent5fad4c4658676be898186c352f216ca72e0e8601 (diff)
downloadgarage-b2f679675e3390bea6c6b3b9fb3632d0ed414a75.tar.gz
garage-b2f679675e3390bea6c6b3b9fb3632d0ed414a75.zip
lifecycle worker: take into account disabled rules
Diffstat (limited to 'src/model/s3/lifecycle_worker.rs')
-rw-r--r--src/model/s3/lifecycle_worker.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/model/s3/lifecycle_worker.rs b/src/model/s3/lifecycle_worker.rs
index 02374bf0..d46d70f3 100644
--- a/src/model/s3/lifecycle_worker.rs
+++ b/src/model/s3/lifecycle_worker.rs
@@ -243,11 +243,15 @@ async fn process_object(
.and_then(|s| s.lifecycle_config.get().as_deref())
.unwrap_or_default();
- if lifecycle_policy.is_empty() {
+ if lifecycle_policy.iter().all(|x| !x.enabled) {
return Ok(Skip::SkipBucket);
}
for rule in lifecycle_policy.iter() {
+ if !rule.enabled {
+ continue;
+ }
+
if let Some(pfx) = &rule.filter.prefix {
if !object.key.starts_with(pfx) {
continue;