Register runner when starting script

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Lee Smet
2025-09-04 17:36:21 +02:00
parent 059d5131e7
commit c38937f1cb
4 changed files with 93 additions and 6 deletions

View File

@@ -522,10 +522,7 @@ pub fn start_inbound_listener(
loop {
// Poll for inbound supervisor messages on the configured topic
match mycelium
.pop_message(Some(false), Some(20), Some(cfg.topic.as_str()))
.await
{
match mycelium.pop_message(Some(false), Some(20), None).await {
Ok(Some(inb)) => {
// Expect InboundMessage with base64 "payload"
let Some(payload_b64) = inb.get("payload").and_then(|v| v.as_str()) else {
@@ -545,6 +542,10 @@ pub fn start_inbound_listener(
.await;
continue;
};
tracing::info!(
raw = %String::from_utf8_lossy(&raw),
"Read raw messge from mycelium"
);
let Ok(rpc): Result<Value, _> = serde_json::from_slice(&raw) else {
// Invalid JSON payload
continue;