Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
acabarbaye authored Feb 11, 2025
1 parent 1c67482 commit a771ae8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions utils/subprocess/supervisor/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import "context"

//go:generate mockgen -destination=../../mocks/mock_$GOPACKAGE.go -package=mocks github.com/ARM-software/golang-utils/utils/subprocess/$GOPACKAGE ISupervisor

// ISupervisor will run a command and automatically restart it if it exits. Hooks can be used to execute code at
// different points in the execution lifecyle. Restarts can be delayed
type ISupervisor interface {
// Run will run the supervisor and execute any of the command hooks. If it receives a halting error or the context is cancelled then it will exit
Run(ctx context.Context) error
}
2 changes: 1 addition & 1 deletion utils/subprocess/supervisor/supervisor.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func WithPostStop(function func(context.Context, error) error) SupervisorOption
}
}

// WithHaltingErrors are errors that won't trigger the supervisor to restart
// WithHaltingErrors are errors that won't trigger the supervisor to restart and on which, the subprocess will just halt.
func WithHaltingErrors(errs ...error) SupervisorOption {
return func(s *Supervisor) {
s.haltingErrors = errs
Expand Down

0 comments on commit a771ae8

Please sign in to comment.