From 000885c1d5a23eb353c3f490e32363010ca804d3 Mon Sep 17 00:00:00 2001 From: rtkay123 Date: Sat, 16 Aug 2025 00:47:43 +0200 Subject: feat(config): identify resource to reload --- crates/configuration/src/state.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'crates/configuration/src/state.rs') 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()))?; -- cgit v1.2.3