diff --git a/spec/retry_spec.cr b/spec/retry_spec.cr index f67700e..8183ba5 100644 --- a/spec/retry_spec.cr +++ b/spec/retry_spec.cr @@ -15,7 +15,7 @@ describe SimpleRetry do SimpleRetry.try_to(raise_on: DivisionByZeroError) do |count| raise "some issue" if count < 5 final_count = count - result = count // 0 + count // 0 count end end @@ -27,7 +27,7 @@ describe SimpleRetry do expect_raises(Exception) do SimpleRetry.try_to(retry_on: DivisionByZeroError) do |count| final_count = count - result = count // 0 if count < 3 + count // 0 if count < 3 raise "different error" count end @@ -52,7 +52,7 @@ describe SimpleRetry do final_count = SimpleRetry.try_to( base_interval: 10.milliseconds, max_interval: 50.milliseconds - ) do |count, last_error, sleep_time| + ) do |count, _, sleep_time| times << sleep_time raise "some issue" if count < 7 count @@ -75,7 +75,7 @@ describe SimpleRetry do randomise: 9.milliseconds, base_interval: 10.milliseconds, max_interval: 50.milliseconds - ) do |count, last_error, sleep_time| + ) do |count, _, sleep_time| times << sleep_time raise "some issue" if count < 7 count diff --git a/src/simple_retry.cr b/src/simple_retry.cr index 115e0f5..2ffb0f0 100644 --- a/src/simple_retry.cr +++ b/src/simple_retry.cr @@ -33,6 +33,7 @@ module SimpleRetry end end + # ameba:disable Metrics/CyclomaticComplexity def try_to( max_attempts : Int? = nil, retry_on : Exception.class | Nil = nil, @@ -73,6 +74,7 @@ module SimpleRetry end end + # ameba:disable Metrics/CyclomaticComplexity def try_to( randomise : Time::Span, max_attempts : Int? = nil,