MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / shouldAttemptAutoReconnect

Function shouldAttemptAutoReconnect

pkg/jobcontroller/jobcontroller.go:381–397  ·  view source on GitHub ↗
(jobId string)

Source from the content-addressed store, hash-verified

379}
380
381func shouldAttemptAutoReconnect(jobId string) bool {
382 now := time.Now().Unix()
383 lastAttempt, exists := lastAutoReconnectAttempt.GetEx(jobId)
384
385 if !exists {
386 lastAutoReconnectAttempt.Set(jobId, now)
387 return true
388 }
389
390 timeSinceLastAttempt := time.Duration(now-lastAttempt) * time.Second
391 if timeSinceLastAttempt >= AutoReconnectCooldown {
392 lastAutoReconnectAttempt.Set(jobId, now)
393 return true
394 }
395
396 return false
397}
398
399func attemptAutoReconnect(jobId string, connName string) {
400 defer func() {

Callers 1

handleRouteEventFunction · 0.85

Calls 2

GetExMethod · 0.80
SetMethod · 0.45

Tested by

no test coverage detected