fix: better ssh resilience and customizable timeout for future backoff

This commit is contained in:
Aarnav Tale
2025-06-16 11:23:44 -04:00
parent 6a0e097412
commit 7f376c3f70
4 changed files with 48 additions and 31 deletions
+1 -2
View File
@@ -50,8 +50,7 @@ func (i *TsWasmIpn) NewSSHSession(hostname, username string, termConfig *SSHXter
func (s *SSHSession) ConnectAndRun() {
defer s.TermConfig.OnDisconnect()
// Default to a 5 second timeout for the connection AFTER dial.
ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(s.TermConfig.Timeout)*time.Second)
defer cancel()
// TODO: Log here