sleep to ensure the message is received
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
75cdab0ab2
commit
ff810ac5dc
@ -793,10 +793,16 @@ impl Connection {
|
|||||||
self.send(msg_out).await;
|
self.send(msg_out).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[inline]
|
||||||
|
async fn sleep_to_ensure_msg_recved() {
|
||||||
|
sleep(1.).await;
|
||||||
|
}
|
||||||
|
|
||||||
async fn check_privacy_mode_on(&mut self) -> bool {
|
async fn check_privacy_mode_on(&mut self) -> bool {
|
||||||
if video_service::get_privacy_mode_conn_id() > 0 {
|
if video_service::get_privacy_mode_conn_id() > 0 {
|
||||||
self.send_login_error("Someone turns on privacy mode, exit")
|
self.send_login_error("Someone turns on privacy mode, exit")
|
||||||
.await;
|
.await;
|
||||||
|
Self::sleep_to_ensure_msg_recved().await;
|
||||||
false
|
false
|
||||||
} else {
|
} else {
|
||||||
true
|
true
|
||||||
@ -828,7 +834,7 @@ impl Connection {
|
|||||||
true,
|
true,
|
||||||
json!({ "ip":addr.ip() }),
|
json!({ "ip":addr.ip() }),
|
||||||
);
|
);
|
||||||
sleep(1.).await;
|
Self::sleep_to_ensure_msg_recved().await;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user