From 7e9b3d5fb7b73a039aeb2db5b5f3fb042213b676 Mon Sep 17 00:00:00 2001 From: QuantumEntangledAndy Date: Thu, 19 Oct 2023 09:32:36 +0700 Subject: [PATCH] Fixes --- src/common/pushnoti.rs | 2 +- src/common/reactor.rs | 2 +- src/mqtt/mod.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/pushnoti.rs b/src/common/pushnoti.rs index c480632..7725540 100644 --- a/src/common/pushnoti.rs +++ b/src/common/pushnoti.rs @@ -117,7 +117,7 @@ impl PushNotiThread { let mut listener = FcmPushListener::create( registration, |message: FcmMessage| { - log::debug!("Got FCM Message: {message:?}"); + log::debug!("Got FCM Message: {message.payload_json:?}"); thread_pn_watcher.send_replace(Some(PushNoti { message: message.payload_json, id: message.persistent_id, diff --git a/src/common/reactor.rs b/src/common/reactor.rs index ae921d2..9189f83 100644 --- a/src/common/reactor.rs +++ b/src/common/reactor.rs @@ -39,6 +39,7 @@ impl NeoReactor { pub(crate) async fn new(config: Config) -> Self { let (commad_tx, mut command_rx) = mpsc(100); let (push_noti, mut pn_rx) = mpsc(10); + let pn_tx = push_noti.clone(); let cancel = CancellationToken::new(); let (config_tx, _) = watch(config); let mut set = JoinSet::new(); @@ -116,7 +117,6 @@ impl NeoReactor { // Push notification client let cancel1 = cancel.clone(); - let pn_tx = push_noti.clone(); set.spawn(async move { tokio::select! { _ = cancel1.cancelled() => AnyResult::Ok(()), diff --git a/src/mqtt/mod.rs b/src/mqtt/mod.rs index a0b1cf5..c90e14f 100644 --- a/src/mqtt/mod.rs +++ b/src/mqtt/mod.rs @@ -969,10 +969,10 @@ async fn handle_mqtt_message( let reply = match message.parse::() { Ok(secs) => { if let Ok(permit) = camera.permit().await { - let (tx, rx) = mpsc(1); + let (tx, mut rx) = mpsc(1); // By using a run_task we can delay the countdown until AFTER we are connected - let _ = camera.run_task(|cam| { + let _ = camera.run_task(|_cam| { let tx = tx.clone(); Box::pin(async move { let _ = tx.try_send(()); // Camera online, start the countdown