commit | 34c61308ed065a9125b89b6baf829e3066bd3ba9 | [log] [tgz] |
---|---|---|
author | Luca Milanesio <luca.milanesio@gmail.com> | Thu Oct 10 08:29:40 2013 +0100 |
committer | Luca Milanesio <luca.milanesio@gmail.com> | Fri Oct 11 14:11:29 2013 +0000 |
tree | 1a2d5ac2c62efaf522f16e8f973070912c923dc1 | |
parent | 4d8c5230340abcbbb67a3f483f380e8f0800a217 [diff] |
Removing redundant calls to GitHub. The recurring usage of hub.getMyself() would eagerly eat up the GitHub API allowance and artificially produce lots of 502 errors. Change-Id: I80fe09828eacd1fe98469ac76c58f1794cacba13
diff --git a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubLogin.java b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubLogin.java index b7f45ed..38a0eb6 100644 --- a/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubLogin.java +++ b/github-oauth/src/main/java/com/googlesource/gerrit/plugins/github/oauth/GitHubLogin.java
@@ -73,7 +73,7 @@ public boolean isLoggedIn(Set<Scope> scopes) { boolean loggedIn = scopesSet.equals(scopes) && token != null && hub != null; - if (loggedIn) { + if (loggedIn && myself == null) { try { myself = hub.getMyself(); } catch (Throwable e) {