mirror of
https://github.com/tauri-apps/tauri.git
synced 2026-04-01 10:01:07 +02:00
Fix tauri-cli connection to dev server stucks and waits for TCP timeout.
This commit is contained in:
@@ -278,11 +278,15 @@ fn command_internal(mut options: Options) -> Result<()> {
|
||||
};
|
||||
let mut i = 0;
|
||||
let sleep_interval = std::time::Duration::from_secs(2);
|
||||
let timeout_duration = std::time::Duration::from_secs(1);
|
||||
let max_attempts = 90;
|
||||
loop {
|
||||
if std::net::TcpStream::connect(addrs).is_ok() {
|
||||
break;
|
||||
'waiting: loop {
|
||||
for addr in addrs.iter() {
|
||||
if std::net::TcpStream::connect_timeout(addr, timeout_duration).is_ok() {
|
||||
break 'waiting;
|
||||
}
|
||||
}
|
||||
|
||||
if i % 3 == 1 {
|
||||
warn!(
|
||||
"Waiting for your frontend dev server to start on {}...",
|
||||
|
||||
Reference in New Issue
Block a user