diff --git a/implementation/retry/retry.go b/implementation/retry/retry.go index 74b8053..1bc2f7e 100644 --- a/implementation/retry/retry.go +++ b/implementation/retry/retry.go @@ -28,23 +28,23 @@ type RetryImpl struct { SilenceGivingUp bool } -func NewWithOpts( +func NewWithOptions( wrapped aurestclientapi.Client, condition aurestclientapi.RetryConditionCallback, - options RetryOptions, + opts RetryOptions, ) aurestclientapi.Client { repeatCount := uint8(2) - if options.RepeatCount > 0 { - repeatCount = options.RepeatCount + if opts.RepeatCount > 0 { + repeatCount = opts.RepeatCount } return &RetryImpl{ Wrapped: wrapped, RepeatCount: repeatCount, RetryCondition: condition, - BeforeRetry: options.BeforeRetryOrNil, + BeforeRetry: opts.BeforeRetryOrNil, RetryingMetricsCallback: doNothingMetricsCallback, GivingUpMetricsCallback: doNothingMetricsCallback, - SilenceGivingUp: options.SilenceGivingUp, + SilenceGivingUp: opts.SilenceGivingUp, } } diff --git a/implementation/retry/retry_test.go b/implementation/retry/retry_test.go index 442b130..271c507 100644 --- a/implementation/retry/retry_test.go +++ b/implementation/retry/retry_test.go @@ -131,7 +131,7 @@ func TestFailWithRetryWithOpts(t *testing.T) { aulogging.SetupNoLoggerForTesting() mock := tstMock() - cut := NewWithOpts(mock, + cut := NewWithOptions(mock, func(ctx context.Context, response *aurestclientapi.ParsedResponse, err error) bool { return true },