aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/garage/Cargo.toml3
-rw-r--r--src/model/s3/lifecycle_worker.rs5
2 files changed, 6 insertions, 2 deletions
diff --git a/src/garage/Cargo.toml b/src/garage/Cargo.toml
index 9cc71abd..a1778355 100644
--- a/src/garage/Cargo.toml
+++ b/src/garage/Cargo.toml
@@ -63,7 +63,10 @@ syslog-tracing = { workspace = true, optional = true }
[dev-dependencies]
aws-config.workspace = true
+aws-types.workspace = true
+aws-credential-types.workspace = true
aws-sdk-s3.workspace = true
+
chrono.workspace = true
http.workspace = true
hmac.workspace = true
diff --git a/src/model/s3/lifecycle_worker.rs b/src/model/s3/lifecycle_worker.rs
index 9ecf168c..0dcb248d 100644
--- a/src/model/s3/lifecycle_worker.rs
+++ b/src/model/s3/lifecycle_worker.rs
@@ -388,13 +388,14 @@ fn check_size_filter(version_data: &ObjectVersionData, filter: &LifecycleFilter)
fn midnight_ts(date: NaiveDate) -> u64 {
date.and_hms_opt(0, 0, 0)
.expect("midnight does not exist")
+ .and_utc()
.timestamp_millis() as u64
}
fn next_date(ts: u64) -> NaiveDate {
- NaiveDateTime::from_timestamp_millis(ts as i64)
+ DateTime::from_timestamp_millis(ts as i64)
.expect("bad timestamp")
- .date()
+ .date_naive()
.succ_opt()
.expect("no next day")
}