Register runner when starting script
Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user