diff --git a/restartmanager/restartmanager.go b/restartmanager/restartmanager.go index 12094def60..363fcc2af0 100644 --- a/restartmanager/restartmanager.go +++ b/restartmanager/restartmanager.go @@ -21,7 +21,7 @@ var ErrRestartCanceled = errors.New("restart canceled") // RestartManager defines object that controls container restarting rules. type RestartManager interface { - Cancel() error + Cancel() ShouldRestart(exitCode uint32, hasBeenManuallyStopped bool, executionDuration time.Duration) (bool, chan error, error) } @@ -125,12 +125,11 @@ func (rm *restartManager) ShouldRestart(exitCode uint32, hasBeenManuallyStopped return true, ch, nil } -func (rm *restartManager) Cancel() error { +func (rm *restartManager) Cancel() { rm.Do(func() { rm.Lock() rm.canceled = true close(rm.cancel) rm.Unlock() }) - return nil }