From 55a53e8bc005df3b95323a4d81bdf8fd9ed88ff7 Mon Sep 17 00:00:00 2001 From: Jonnern <10881387+Jonnern@users.noreply.github.com> Date: Wed, 2 Oct 2024 13:57:00 +0200 Subject: [PATCH] Fix retry logic in ExecuteWithRetry --- client/shared/utils.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/shared/utils.go b/client/shared/utils.go index ef60ac0..59077ec 100644 --- a/client/shared/utils.go +++ b/client/shared/utils.go @@ -15,7 +15,7 @@ type ExecuteStatus[T any] struct { func ExecuteWithRetry[T any](f func() (T, error), maxRetries int, delay time.Duration) <-chan ExecuteStatus[T] { out := make(chan ExecuteStatus[T]) go func() { - for ri := 0; ri < maxRetries; ri++ { + for ri := 0; ri <= maxRetries; ri++ { result, err := f() if err == nil { out <- ExecuteStatus[T]{Success: true, Value: result}