fix: 修复应用长时间挂后台后恢复时表格数据永久加载的问题

三层防护:
- MySQL 连接获取时执行 ping 健康检查,死连接自动重连
- macOS Reopen 事件 + 前端 visibilitychange 触发连接刷新
- 前端 Promise.race 超时保护,确保 loading 状态不会超过 60s
This commit is contained in:
t8y2 committed 2026-05-29 15:12:14 +08:00
1 parent 6c0db6f517
commit b54eda1889
8 files changed
+157 -13

No files matched your search

+6
View File
@@ -511,3 +511,9 @@ pub async fn disconnect_db(state: State<'_, Arc<AppState>>, connection_id: Strin
state.reset_connection_transport(&connection_id).await;
Ok(())
}
#[tauri::command]
pub async fn refresh_connections(state: State<'_, Arc<AppState>>) -> Result<(), String> {
state.refresh_connections().await;
Ok(())
}