diff options
| author | Bilal Acar <biacar@amazon.com> | 2021-08-20 09:21:39 -0700 |
|---|---|---|
| committer | Michael Klishin <michael@clojurewerkz.org> | 2021-08-21 00:45:07 +0300 |
| commit | ca018ef11023b49db9bc221e09768d3af174618e (patch) | |
| tree | 896626ad1d048acb9f175bf70d9cddebae44e7f8 | |
| parent | 50f9bcf504c6c6fc2bad0108f0d79e741010a066 (diff) | |
| download | rabbitmq-server-git-ca018ef11023b49db9bc221e09768d3af174618e.tar.gz | |
Addressing PR comments
| -rw-r--r-- | deps/rabbitmq_aws/src/rabbitmq_aws.erl | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/deps/rabbitmq_aws/src/rabbitmq_aws.erl b/deps/rabbitmq_aws/src/rabbitmq_aws.erl index 3ba6e58b12..acf2a8f82b 100644 --- a/deps/rabbitmq_aws/src/rabbitmq_aws.erl +++ b/deps/rabbitmq_aws/src/rabbitmq_aws.erl @@ -555,10 +555,10 @@ api_get_request_with_retries(Service, Path, Retries, WaitTimeBetweenRetries) -> {ok, {_Headers, Payload}} -> rabbit_log:debug("AWS request: ~s~nResponse: ~p", [Path, Payload]), {ok, Payload}; {error, {credentials, _}} -> {error, credentials}; - {error, Message, _} -> case Retries of - 0 -> {error, Message}; - _ -> rabbit_log:warning("Error occurred ~s~nWill retry AWS request, remaining retries: ~b", [Message, Retries]), - timer:sleep(WaitTimeBetweenRetries), - api_get_request_with_retries(Service, Path, Retries - 1, WaitTimeBetweenRetries) + {error, Message, _} -> case Retries > 0 of + true -> rabbit_log:warning("Error occurred ~s~nWill retry AWS request, remaining retries: ~b", [Message, Retries]), + timer:sleep(WaitTimeBetweenRetries), + api_get_request_with_retries(Service, Path, Retries - 1, WaitTimeBetweenRetries); + false -> {error, Message} end end. |
