WithRetry enables automatic retry on command failure. maxAttempts controls how many times the command will be executed total (1 initial + N retries). A retry sleep of attempt * time.Second is applied between attempts.
(maxAttempts int)
| 68 | // maxAttempts controls how many times the command will be executed total (1 initial + N retries). |
| 69 | // A retry sleep of attempt * time.Second is applied between attempts. |
| 70 | func (e *executor) WithRetry(maxAttempts int) *executor { |
| 71 | e.retryMaxAttempts = maxAttempts |
| 72 | return e |
| 73 | } |
| 74 | |
| 75 | // ExecuteOutput executes the command quietly and returns its combined stdout/stderr as a string. |
| 76 | func (e *executor) ExecuteOutput() (string, error) { |
no outgoing calls