Sleep for only one second if the gtk sender can't be found

This probably means that the main app hasn't started yet. Just sleep for one second before retrying.
This commit is contained in:
Savanni D'Gerinel 2023-09-21 09:37:56 -04:00
parent d6c2a9519b
commit 3d460e5840
1 changed files with 3 additions and 3 deletions

View File

@ -110,8 +110,10 @@ pub fn main() {
if let Some(ref gtk_tx) = *core.tx.read().unwrap() { if let Some(ref gtk_tx) = *core.tx.read().unwrap() {
let _ = gtk_tx.send(Message::Refresh(state.clone())); let _ = gtk_tx.send(Message::Refresh(state.clone()));
std::thread::sleep(std::time::Duration::from_secs(60));
} else {
std::thread::sleep(std::time::Duration::from_secs(1));
} }
std::thread::sleep(std::time::Duration::from_secs(60));
} }
} }
}); });
@ -134,8 +136,6 @@ pub fn main() {
Continue(true) Continue(true)
} }
}); });
std::thread::spawn(move || {});
}); });
let args: Vec<String> = env::args().collect(); let args: Vec<String> = env::args().collect();