diff options
author | rtkay123 <dev@kanjala.com> | 2025-08-16 00:47:43 +0200 |
---|---|---|
committer | rtkay123 <dev@kanjala.com> | 2025-08-16 00:47:43 +0200 |
commit | 000885c1d5a23eb353c3f490e32363010ca804d3 (patch) | |
tree | 74f320a969b45f765a4826f31ee88064822cdccd /crates/configuration/src/state.rs | |
parent | 4a82b6db8a1278588b97b874bad468ec6f7cda6c (diff) | |
download | warden-000885c1d5a23eb353c3f490e32363010ca804d3.tar.bz2 warden-000885c1d5a23eb353c3f490e32363010ca804d3.zip |
feat(config): identify resource to reload
Diffstat (limited to 'crates/configuration/src/state.rs')
-rw-r--r-- | crates/configuration/src/state.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/configuration/src/state.rs b/crates/configuration/src/state.rs index d8f22d5..f337a54 100644 --- a/crates/configuration/src/state.rs +++ b/crates/configuration/src/state.rs @@ -4,6 +4,7 @@ mod rule; use async_nats::jetstream::Context; use opentelemetry_semantic_conventions::attribute; +use prost::Message; use sqlx::PgPool; use std::{ops::Deref, sync::Arc}; use tracing::{Instrument, info_span, instrument, trace}; @@ -91,10 +92,11 @@ pub async fn publish_reload( span.set_attribute(attribute::MESSAGING_SYSTEM, "nats"); span.set_attribute("otel.kind", "producer"); + let bytes = event.encode_to_vec(); state .services .jetstream - .publish(format!("{prefix}.reload"), event.as_str_name().into()) + .publish(format!("{prefix}.reload"), bytes.into()) .instrument(span) .await .map_err(|e| tonic::Status::internal(e.to_string()))?; |