debug: add INFO logging to ensure_stream and remote_actor_posts_handler
Some checks failed
lint / lint (push) Has been cancelled
test / unit (push) Has been cancelled
test / integration (push) Has been cancelled
lint / lint (pull_request) Failing after 9m42s
test / unit (pull_request) Failing after 10m52s
test / integration (pull_request) Failing after 17m20s

This commit is contained in:
2026-05-14 22:59:12 +02:00
parent 612b7f069b
commit 7bbc702e85
2 changed files with 43 additions and 19 deletions

View File

@@ -39,12 +39,17 @@ pub async fn ensure_stream(client: &async_nats::Client) -> Result<(), DomainErro
// Try to update first (covers the case where stream exists with stale subjects).
// Falls back to create if the stream doesn't exist yet.
match js.update_stream(stream_config()).await {
Ok(_) => Ok(()),
Err(_) => js
.get_or_create_stream(stream_config())
.await
.map(|_| ())
.map_err(|e| DomainError::Internal(format!("JetStream stream setup failed: {e}"))),
Ok(_) => {
tracing::info!(subjects = ?STREAM_SUBJECTS, "JetStream stream updated");
Ok(())
}
Err(e) => {
tracing::warn!("JetStream stream update failed ({e}), falling back to get_or_create");
js.get_or_create_stream(stream_config())
.await
.map(|_| ())
.map_err(|e| DomainError::Internal(format!("JetStream stream setup failed: {e}")))
}
}
}