1暂时提交

This commit is contained in:
2025-08-11 09:27:32 +08:00
parent 56a761e5ab
commit 4b28684fe4
16 changed files with 980 additions and 209 deletions

View File

@ -1,7 +1,6 @@
package retryhelper
import (
"fmt"
"math"
"time"
)
@ -50,5 +49,5 @@ func RetryWithResult[T any](op func() (T, error), opts RetryOptions) (result T,
interval = time.Duration(math.Min(float64(opts.MaxInterval), float64(interval)*opts.BackoffFactor))
}
}
return result, fmt.Errorf("retry failed after %d attempts, last error: %w", opts.MaxRetries+1, err)
return result, err
}