async: use tokio for thread block calls

This commit is contained in:
ardocrat
2025-04-02 19:15:20 +03:00
parent 3da8f5420b
commit a1b3330e5e
4 changed files with 16 additions and 18 deletions
+2 -2
View File
@@ -78,7 +78,7 @@ impl ExternalConnection {
}
}
/// Check external connections availability.
/// Check external connection availability.
pub fn check(id: Option<i64>, ui_ctx: &egui::Context) {
let conn_list = ConnectionsConfig::ext_conn_list();
for conn in conn_list {
@@ -99,7 +99,7 @@ fn check_ext_conn(conn: &ExternalConnection, ui_ctx: &egui::Context) {
let ui_ctx = ui_ctx.clone();
ConnectionsConfig::update_ext_conn_status(conn.id, None);
std::thread::spawn(move || {
tokio::runtime::Builder::new_multi_thread()
tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()
.unwrap()