Skip to content

Commit 95fcbd6

Browse files
committed
Wait for helper socket to appear before connecting
1 parent 180e5e9 commit 95fcbd6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/gui.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1974,7 +1974,14 @@ fn execute_action(config_path: &Path, action: GuiAction) -> Result<String> {
19741974
}
19751975
}
19761976

1977+
// Wait for the socket to appear (helper may take a moment to start).
19771978
let socket = helper_ipc::socket_path();
1979+
if !socket.exists() {
1980+
let deadline = Instant::now() + Duration::from_secs(5);
1981+
while !socket.exists() && Instant::now() < deadline {
1982+
thread::sleep(Duration::from_millis(200));
1983+
}
1984+
}
19781985
let request = match action {
19791986
GuiAction::Start => helper_ipc::HelperRequest::Start {
19801987
config_path: config_path.to_path_buf(),

0 commit comments

Comments
 (0)