1暂时提交
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user