mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
fixing: Reimplement https://github.com/Start9Labs/start-os/pull/2391 (#2437)
* fixing: Reimplement https://github.com/Start9Labs/start-os/pull/2391 * remove the none thing
This commit is contained in:
@@ -82,6 +82,8 @@ async fn deal_with_messages(
|
|||||||
mut sub: patch_db::Subscriber,
|
mut sub: patch_db::Subscriber,
|
||||||
mut stream: WebSocketStream<Upgraded>,
|
mut stream: WebSocketStream<Upgraded>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
|
let mut timer = tokio::time::interval(tokio::time::Duration::from_secs(5));
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
futures::select! {
|
futures::select! {
|
||||||
_ = (&mut kill).fuse() => {
|
_ = (&mut kill).fuse() => {
|
||||||
@@ -112,6 +114,13 @@ async fn deal_with_messages(
|
|||||||
_ => (),
|
_ => (),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// This is trying to give a health checks to the home to keep the ui alive.
|
||||||
|
_ = timer.tick().fuse() => {
|
||||||
|
stream
|
||||||
|
.send(Message::Ping(vec![]))
|
||||||
|
.await
|
||||||
|
.with_kind(crate::ErrorKind::Network)?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user