Skip to content

Commit 8c3f1a8

Browse files
fix: Feedviastdin total retires
If total retries is not set then it will never execute the binary because we start the for loop at 1, changing to 0 means it at least tries to execute the binary once before attempting the total retries.
1 parent dc188f5 commit 8c3f1a8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cmd/root.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,8 @@ func feedViaStdin(ctx context.Context, custom *custom.CustomBouncer, config *cfg
108108
log.Errorf("Binary exited: %s", err)
109109
}
110110
} else {
111-
for i := 1; i <= config.TotalRetries; i++ {
111+
// i needs to start at 0 so we at least try once to start the process if config.TotalRetires is not set
112+
for i := 0; i <= config.TotalRetries; i++ {
112113
err = f()
113114
log.Errorf("Binary exited (retry %d/%d): %s", i, config.TotalRetries, err)
114115
}

0 commit comments

Comments
 (0)