MCPcopy Create free account
hub / github.com/Thunder-Compute/thunder-cli / shouldRetryDial

Function shouldRetryDial

utils/ssh.go:380–399  ·  view source on GitHub ↗
(err error)

Source from the content-addressed store, hash-verified

378}
379
380func shouldRetryDial(err error) bool {
381 if err == nil {
382 return false
383 }
384 if netErr, ok := err.(net.Error); ok {
385 if netErr.Timeout() {
386 return true
387 }
388 }
389 msg := strings.ToLower(err.Error())
390 return messageContainsAny(msg,
391 "connection refused",
392 "no route to host",
393 "operation timed out",
394 "i/o timeout",
395 "connection reset",
396 "broken pipe",
397 "network is unreachable",
398 )
399}
400
401func shouldRetrySSH(err error) bool {
402 if err == nil {

Callers 3

WaitForTCPPortFunction · 0.85
TestShouldRetryDialFunction · 0.85

Calls 3

messageContainsAnyFunction · 0.85
TimeoutMethod · 0.80
ErrorMethod · 0.45

Tested by 1

TestShouldRetryDialFunction · 0.68