We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd20b26 commit aec9c7bCopy full SHA for aec9c7b
src/main/java/com/twitter/clientlib/api/ApiCommon.java
@@ -44,7 +44,10 @@ protected String[] reduceAuthNames(String[] localVarAuthNames) {
44
45
public boolean handleRateLimit(ApiException e, Integer retries) throws ApiException {
46
boolean retryCall = false;
47
- if (e.getCode() == 429 && retries > 0) {
+ boolean isRateLimitExceeded = (e.getCode() == 429);
48
+ boolean hasRetriesLeft = (retries > 0);
49
+
50
+ if (isRateLimitExceeded && hasRetriesLeft) {
51
long timeToWait = getTimeToWait(e);
52
try {
53
Thread.sleep(timeToWait);
0 commit comments