Skip to content

Commit

Permalink
handle permanent error
Browse files Browse the repository at this point in the history
  • Loading branch information
frenchzed committed May 6, 2024
1 parent 865fca5 commit 669f0b4
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions internal/core/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,17 @@ func (d *DockerManager) Start() (err error) {
ctx, cancel := context.WithCancel(context.Background())
d.cancel = cancel

go backoff.RetryNotify(func() error {
return d.run(ctx)
}, backoff.WithContext(backoff.NewExponentialBackOff(), ctx), func(err error, d time.Duration) {
logger.Errorf("Error running docker manager, retrying in %v: %s", d, err)
})
go func() {
perr := backoff.RetryNotify(func() error {
return d.run(ctx)
}, backoff.WithContext(backoff.NewExponentialBackOff(), ctx), func(err error, d time.Duration) {
logger.Errorf("Error running docker manager, retrying in %v: %s", d, err)
})
if perr != nil {
logger.Errorf("Unrecoverable error running docker manager: %s", perr)
cancel()
}
}()

return nil
}
Expand Down

0 comments on commit 669f0b4

Please sign in to comment.