mirror of
https://github.com/jlengrand/github-api.git
synced 2026-03-10 15:49:57 +00:00
Fixed rate handling limit handling
Issue #220. If RateLimitHandler returns normally, it should retry.
This commit is contained in:
@@ -501,6 +501,7 @@ class Requester {
|
||||
|
||||
if ("0".equals(uc.getHeaderField("X-RateLimit-Remaining"))) {
|
||||
root.rateLimitHandler.onError(e,uc);
|
||||
return;
|
||||
}
|
||||
|
||||
InputStream es = wrapStream(uc.getErrorStream());
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import org.kohsuke.github.GHRepository;
|
||||
import org.kohsuke.github.GHUser;
|
||||
import org.kohsuke.github.GitHub;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -14,4 +15,11 @@ public class Foo {
|
||||
}
|
||||
System.out.println(lst.size());
|
||||
}
|
||||
|
||||
private static void testRateLimit() throws Exception {
|
||||
GitHub g = GitHub.connectAnonymously();
|
||||
for (GHUser u : g.getOrganization("jenkinsci").listMembers()) {
|
||||
u.getFollowersCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user