mirror of
https://github.com/hexedtech/codemp.git
synced 2024-12-23 05:14:54 +01:00
fix: missing await, debug on ignorableErr, content
This commit is contained in:
parent
0bd8f0541d
commit
488c22c0f1
4 changed files with 4 additions and 6 deletions
|
@ -74,7 +74,7 @@ impl Controller<TextChange> for BufferController {
|
|||
|
||||
async fn poll(&self) -> crate::Result<()> {
|
||||
let (tx, rx) = oneshot::channel::<()>();
|
||||
self.poller.send(tx);
|
||||
self.poller.send(tx).await?;
|
||||
Ok(rx.await.map_err(|_| crate::Error::Channel { send: false })?)
|
||||
}
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ impl ControllerWorker<TextChange> for BufferControllerWorker {
|
|||
match self.send_op(&mut tx, &op).await {
|
||||
Err(e) => tracing::error!("server refused to broadcast {}: {}", op, e),
|
||||
Ok(()) => {
|
||||
// self.content.send(self.buffer.view()).unwrap_or_warn("could not send buffer update");
|
||||
self.content.send(self.buffer.view()).unwrap_or_warn("could not send buffer update");
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -161,7 +161,6 @@ impl ControllerWorker<TextChange> for BufferControllerWorker {
|
|||
},
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
use std::{sync::Arc, collections::BTreeMap};
|
||||
|
||||
use tokio::sync::mpsc;
|
||||
use tokio_stream::StreamExt;
|
||||
use tonic::transport::Channel;
|
||||
|
||||
use crate::{
|
||||
|
|
|
@ -12,11 +12,11 @@ pub trait IgnorableError {
|
|||
}
|
||||
|
||||
impl<T, E> IgnorableError for StdResult<T, E>
|
||||
where E : std::fmt::Display {
|
||||
where E : std::fmt::Debug {
|
||||
fn unwrap_or_warn(self, msg: &str) {
|
||||
match self {
|
||||
Ok(_) => {},
|
||||
Err(e) => warn!("{}: {}", msg, e),
|
||||
Err(e) => warn!("{}: {:?}", msg, e),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue