fix: 临时避免 CPU 占用率高的问题。

This commit is contained in:
2023-06-10 21:09:36 +08:00
parent 268ec1df81
commit bab3b8941e
8 changed files with 551 additions and 566 deletions

View File

@@ -54,7 +54,7 @@ impl Board {
board_message_channels.volume_setting_request_sender.clone();
loop {
match socket.try_recv(&mut buf) {
match socket.recv(&mut buf).await {
Ok(len) => {
log::info!("recv: {:?}", &buf[..len]);
if buf[0] == 3 {

View File

@@ -54,7 +54,7 @@ impl UdpRpc {
}
}
});
let shared_self_for_check = shared_self.clone();
tokio::spawn(async move {
shared_self_for_check.check_boards().await;
@@ -99,7 +99,9 @@ impl UdpRpc {
}
if boards.insert(board_info.fullname.clone(), board).is_some() {
info!("added board {:?}", board_info);
info!("replace board {:?}", board_info);
} else {
info!("add board {:?}", board_info);
}
let tx_boards = boards