diff --git a/src/mqtt_interface.rs b/src/mqtt_interface.rs index 036dca1..aa41672 100644 --- a/src/mqtt_interface.rs +++ b/src/mqtt_interface.rs @@ -73,7 +73,16 @@ async fn event_loop_task( match incoming { rumqttc::Packet::ConnAck(_) => { info!("MQTT connected"); - interface.publish_connected(true).await?; + { + // HACK: this really should just be await + // but that can sometimes deadlock if the publish channel is full + let mut interface = interface.clone(); + let fut = async move { + interface.publish_connected(true).await + }; + tokio::spawn(fut); + } + //.await?; } _ => {} }