Fixes
This commit is contained in:
3 files changed
+4
-4
No files matched your search
@@ -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,
|
||||
|
||||
@@ -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(()),
|
||||
|
||||
+2
-2
@@ -969,10 +969,10 @@ async fn handle_mqtt_message(
|
||||
let reply = match message.parse::<u64>() {
|
||||
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
|
||||
|
||||
Reference in new issue
Block a user