Skip to content

Commit

Permalink
restartmanager: RestartManager.Cancel(): remove unused error return
Browse files Browse the repository at this point in the history
This function would never return an error, and no code was handling errors.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah committed Dec 28, 2022
1 parent 598c295 commit d68b68f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions restartmanager/restartmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down Expand Up @@ -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
}

0 comments on commit d68b68f

Please sign in to comment.