From e0e8e9022cb462386107a6497866e133acfe37e6 Mon Sep 17 00:00:00 2001 From: Liam Kinne Date: Thu, 20 Jun 2024 14:51:05 +1000 Subject: [PATCH] Add max_bytes config option to object store --- async-nats/src/jetstream/context.rs | 1 + async-nats/src/jetstream/object_store/mod.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/async-nats/src/jetstream/context.rs b/async-nats/src/jetstream/context.rs index 15721432a..b7c4e5185 100644 --- a/async-nats/src/jetstream/context.rs +++ b/async-nats/src/jetstream/context.rs @@ -1119,6 +1119,7 @@ impl Context { description: config.description.clone(), subjects: vec![chunk_subject, meta_subject], max_age: config.max_age, + max_bytes: config.max_bytes, storage: config.storage, num_replicas: config.num_replicas, discard: DiscardPolicy::New, diff --git a/async-nats/src/jetstream/object_store/mod.rs b/async-nats/src/jetstream/object_store/mod.rs index a3649efc8..73abca56a 100644 --- a/async-nats/src/jetstream/object_store/mod.rs +++ b/async-nats/src/jetstream/object_store/mod.rs @@ -72,6 +72,8 @@ pub struct Config { /// Maximum age of any value in the bucket, expressed in nanoseconds #[serde(default, with = "serde_nanos")] pub max_age: Duration, + /// How large the storage bucket may become in total bytes. + pub max_bytes: i64, /// The type of storage backend, `File` (default) and `Memory` pub storage: StorageType, /// How many replicas to keep for each value in a cluster, maximum 5.