Skip to content

Commit

Permalink
vary tick duration on self-transport error
Browse files Browse the repository at this point in the history
  • Loading branch information
0pcom committed Apr 13, 2024
1 parent 2d663ae commit 9594c08
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/visor/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -1265,13 +1265,16 @@ func initEnsureVisorIsTransportable(ctx context.Context, v *Visor, log *logging.
tries++
v.isServicesHealthy.unset()
log.WithError(err).Warn(fmt.Sprintf("Visor is not transportable! Attempt %v of 3", tries))
//reduce tick duration on non nil error
ticker.Reset(time.Minute)
} else {
tries = 0
v.isServicesHealthy.set()
err = v.RemoveTransport(tpsummary.ID)
if err != nil {
log.WithError(err).Warn("Failed to remove self-transport")
}
ticker.Reset(tickDuration)
}
if tries == 3 {
log.WithError(err).Error("Visor is not transportable! 3 failed attempts ; exiting now")
Expand Down

0 comments on commit 9594c08

Please sign in to comment.