fix client heartbeat condition, properly
This commit is contained in:
parent
5b8878c153
commit
cf189c58d6
@ -393,12 +393,14 @@ impl Connection {
|
|||||||
loop {
|
loop {
|
||||||
time::sleep(heartbeat).await;
|
time::sleep(heartbeat).await;
|
||||||
|
|
||||||
let task_count = self.model.task_connect_count() + self.model.task_associate_count();
|
if self.is_closed() {
|
||||||
|
|
||||||
if self.is_closed() || task_count == 0 {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if self.model.task_connect_count() + self.model.task_associate_count() == 0 {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
match self.model.heartbeat().await {
|
match self.model.heartbeat().await {
|
||||||
Ok(()) => {}
|
Ok(()) => {}
|
||||||
Err(err) => eprintln!("{err}"),
|
Err(err) => eprintln!("{err}"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user