aboutsummaryrefslogtreecommitdiff
path: root/src/model/s3/lifecycle_worker.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-08-30 20:02:07 +0200
committerAlex Auvolat <alex@adnab.me>2023-08-30 20:02:07 +0200
commit75ccc5a95c76f31235fcaab8a2c1795693733a4b (patch)
tree2309b19d04875d991bffdad93cdb050c7477123e /src/model/s3/lifecycle_worker.rs
parent7200954318a1b248b4194ee9273bcd2502b50d58 (diff)
downloadgarage-75ccc5a95c76f31235fcaab8a2c1795693733a4b.tar.gz
garage-75ccc5a95c76f31235fcaab8a2c1795693733a4b.zip
lifecycle config: store date as given, try to debug
Diffstat (limited to 'src/model/s3/lifecycle_worker.rs')
-rw-r--r--src/model/s3/lifecycle_worker.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/model/s3/lifecycle_worker.rs b/src/model/s3/lifecycle_worker.rs
index 02e296e7..5641b093 100644
--- a/src/model/s3/lifecycle_worker.rs
+++ b/src/model/s3/lifecycle_worker.rs
@@ -268,7 +268,14 @@ async fn process_object(
LifecycleExpiration::AfterDays(n_days) => {
(now_date - version_date) >= chrono::Duration::days(*n_days as i64)
}
- LifecycleExpiration::AtDate(exp_date) => now_date >= *exp_date,
+ LifecycleExpiration::AtDate(exp_date) => {
+ if let Ok(exp_date) = parse_lifecycle_date(&exp_date) {
+ now_date >= exp_date
+ } else {
+ warn!("Invalid expiraiton date stored in bucket {:?} lifecycle config: {}", bucket.id, exp_date);
+ false
+ }
+ }
};
if size_match && date_match {