Fix tightloop in push notficaiton
This commit is contained in:
2 files changed
+5
-3
No files matched your search
@@ -250,12 +250,14 @@ impl NeoInstance {
|
||||
loop {
|
||||
match source_watch
|
||||
.wait_for(|i| {
|
||||
i.as_ref()
|
||||
.is_some_and(|i| i.message.contains(&format!("\"{uid}\"")))
|
||||
fwatch_tx.borrow().as_ref() != i.as_ref()
|
||||
&& i.as_ref()
|
||||
.is_some_and(|i| i.message.contains(&format!("\"{uid}\"")))
|
||||
})
|
||||
.await
|
||||
{
|
||||
Ok(pn) => {
|
||||
log::debug!("Sending push notification: {:?} about {}", *pn, uid);
|
||||
let _ = fwatch_tx.send_replace(pn.clone());
|
||||
}
|
||||
Err(e) => {
|
||||
|
||||
@@ -23,7 +23,7 @@ pub(crate) struct PushNotiThread {
|
||||
}
|
||||
|
||||
// The push notification
|
||||
#[derive(Clone, Eq, PartialEq)]
|
||||
#[derive(Clone, Eq, PartialEq, Debug)]
|
||||
pub(crate) struct PushNoti {
|
||||
pub(crate) message: String,
|
||||
pub(crate) id: Option<String>,
|
||||
|
||||
Reference in new issue
Block a user