cap retries

main
bel 2025-12-10 08:13:45 -07:00
parent b26afcb325
commit a6aad2820d
1 changed files with 2 additions and 2 deletions

View File

@ -121,7 +121,7 @@ func (e Entrypoint) String() string {
func runner(ctx context.Context, k string, foo func(context.Context) error) func() error {
return func() error {
var err error
for {
for i := 0; i < 3; i++ {
err = foo(ctx)
if ctx.Err() == nil {
log.Printf("%s failed; restarting: %v", k, err)
@ -132,6 +132,6 @@ func runner(ctx context.Context, k string, foo func(context.Context) error) func
case <-time.After(time.Second):
}
}
return err
return fmt.Errorf("failed 3 tries: %w", err)
}
}