Unverified Commit 087d398d authored by wxsm's avatar wxsm Committed by GitHub
Browse files

fix: add maxage to nats stream (#1053)

Add max_age to nats stream when create, 10 min should be very enough for prefill workers to consume. this prevent system crash while nats jetstream hits disk limit by endless growing messages.
parent e94f3444
......@@ -390,6 +390,7 @@ impl NatsQueue {
let stream_config = jetstream::stream::Config {
name: self.stream_name.clone(),
subjects: vec![self.subject.clone()],
max_age: time::Duration::from_secs(60 * 10), // 10 min
..Default::default()
};
client.jetstream().create_stream(stream_config).await?;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment