mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-24 05:03:06 +00:00
fix: high CPU usage
This commit is contained in:
parent
1c2cf3330e
commit
25e3ee848c
1 changed files with 1 additions and 0 deletions
|
@ -118,6 +118,7 @@ async fn ws_handler(
|
|||
) -> impl IntoResponse {
|
||||
ws.on_upgrade(|mut socket| async move {
|
||||
loop {
|
||||
tokio::time::sleep(tokio::time::Duration::from_millis(1200)).await;
|
||||
if state.lock().unwrap().update {
|
||||
socket
|
||||
.send(Message::Text(String::from("reload")))
|
||||
|
|
Loading…
Reference in a new issue