Ver código fonte

restartmanager: RestartManager.Cancel(): remove unused error return

This function would never return an error, and no code was handling errors.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 4 anos atrás
pai
commit
d68b68fc43
1 arquivos alterados com 2 adições e 3 exclusões
  1. 2 3
      restartmanager/restartmanager.go

+ 2 - 3
restartmanager/restartmanager.go

@@ -21,7 +21,7 @@ var ErrRestartCanceled = errors.New("restart canceled")
 
 
 // RestartManager defines object that controls container restarting rules.
 // RestartManager defines object that controls container restarting rules.
 type RestartManager interface {
 type RestartManager interface {
-	Cancel() error
+	Cancel()
 	ShouldRestart(exitCode uint32, hasBeenManuallyStopped bool, executionDuration time.Duration) (bool, chan error, error)
 	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
 	return true, ch, nil
 }
 }
 
 
-func (rm *restartManager) Cancel() error {
+func (rm *restartManager) Cancel() {
 	rm.Do(func() {
 	rm.Do(func() {
 		rm.Lock()
 		rm.Lock()
 		rm.canceled = true
 		rm.canceled = true
 		close(rm.cancel)
 		close(rm.cancel)
 		rm.Unlock()
 		rm.Unlock()
 	})
 	})
-	return nil
 }
 }