Bugfixing heartbeat
This commit is contained in:
parent
3776d7bb4c
commit
0cbe0c767e
2 changed files with 5 additions and 4 deletions
|
|
@ -1,8 +1,7 @@
|
|||
use std::time::Duration;
|
||||
|
||||
use tokio::sync::mpsc;
|
||||
|
||||
use crate::frame::ServerFrames;
|
||||
use std::time::Duration;
|
||||
use tokio::sync::mpsc;
|
||||
use tracing::debug;
|
||||
|
||||
pub(crate) struct Heartbeat {
|
||||
is_running: bool,
|
||||
|
|
@ -34,6 +33,7 @@ impl Heartbeat {
|
|||
interval.tick().await;
|
||||
|
||||
loop {
|
||||
debug!("Heartbeat");
|
||||
interval.tick().await;
|
||||
let _ = self.message.send(ServerFrames::Heartbeat);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -145,6 +145,7 @@ impl Handler {
|
|||
|
||||
}
|
||||
message = receive_message.recv() => {
|
||||
debug!(?message);
|
||||
match message {
|
||||
Some(message) => {
|
||||
let _ = self.connection.write_frame(message).await;
|
||||
|
|
|
|||
Loading…
Reference in a new issue