Skip to content

Commit

Permalink
Lock MQTT connection every time
Browse files Browse the repository at this point in the history
  • Loading branch information
lptr committed Aug 10, 2024
1 parent 90139da commit 17964b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/kernel/mqtt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ async fn handle_mqtt_events(
conn: Arc<Mutex<CriticalSectionRawMutex, EspAsyncMqttConnection>>,
connected: Arc<Signal<CriticalSectionRawMutex, ()>>,
) {
let mut conn = conn.lock().await;
loop {
let mut conn = conn.lock().await;
let event = conn.next().await.expect("Cannot receive message");
match event.payload() {
EventPayload::Received {
Expand Down

0 comments on commit 17964b1

Please sign in to comment.