Extract the WatchEventStream retry mechanism
into the utils including all other retry mechanisms. With this change we fix that the WatchEventStream goroutine does not stop directly when the context is done (but previously only one second after).
This commit is contained in:
@ -245,7 +245,7 @@ func (n *NomadEnvironment) Sample() (runner.Runner, bool) {
|
||||
r, ok := n.idleRunners.Sample()
|
||||
if ok && n.idleRunners.Length() < n.PrewarmingPoolSize() {
|
||||
go func() {
|
||||
err := util.RetryExponentialContext(n.ctx, func() error { return n.createRunner(false) })
|
||||
err := util.RetryExponentialWithContext(n.ctx, func() error { return n.createRunner(false) })
|
||||
if err != nil {
|
||||
log.WithError(err).WithField(dto.KeyEnvironmentID, n.ID().ToString()).
|
||||
Error("Couldn't create new runner for claimed one")
|
||||
|
Reference in New Issue
Block a user