Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/nats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ struct NatsHandle {
// Held to keep the NATS connection alive for the lifetime of the handle.
// The `jetstream` context clones an internal reference, but this field is
// the authoritative owner — dropping the handle drops the connection.
// `dead_code` because we never read it directly after construction.
#[allow(dead_code)]
// Also read by `store_with_config`, which clones it out from under the
// handle lock.
client: async_nats::Client,
jetstream: async_nats::jetstream::Context,
}
Expand Down
5 changes: 4 additions & 1 deletion src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,10 @@ impl ArtifactTransport for ObjectStoreTransport {
let cutoff_millis = std::time::SystemTime::now()
.checked_sub(grace)
.and_then(|t| t.duration_since(std::time::UNIX_EPOCH).ok())
.map_or(0, |d| d.as_millis() as i64);
// Saturate rather than `as i64`, which would silently wrap a
// >292-million-year value — unreachable for wall-clock millis, but
// the same discipline as the nats.rs max_age conversion.
.map_or(0, |d| i64::try_from(d.as_millis()).unwrap_or(i64::MAX));

let mut deleted = 0usize;
let mut listing = self.store.list(Some(&self.payloads_dir(key)));
Expand Down
Loading