mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 17:18:37 +01:00
Fix rate limit exception in update checker (#4731)
This commit is contained in:
parent
739600eb05
commit
bb88a6a749
@ -96,9 +96,8 @@ public final class UpdateChecker {
|
||||
// Locally built?
|
||||
pendingReleaseFuture.complete(cachedRelease = new RemoteVersion(BranchStatus.UNKNOWN));
|
||||
break catchBlock;
|
||||
}
|
||||
if (connection.getResponseCode() == HttpURLConnection.HTTP_INTERNAL_ERROR) {
|
||||
// Github is down
|
||||
} else if (connection.getResponseCode() == HttpURLConnection.HTTP_INTERNAL_ERROR || connection.getResponseCode() == HttpURLConnection.HTTP_FORBIDDEN) {
|
||||
// GitHub is down or rate limit exceeded
|
||||
pendingReleaseFuture.complete(new RemoteVersion(BranchStatus.ERROR));
|
||||
break catchBlock;
|
||||
}
|
||||
@ -146,8 +145,7 @@ public final class UpdateChecker {
|
||||
if (connection.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
|
||||
// Locally built?
|
||||
return new RemoteVersion(BranchStatus.UNKNOWN);
|
||||
}
|
||||
if (connection.getResponseCode() == HttpURLConnection.HTTP_INTERNAL_ERROR || connection.getResponseCode() == HttpURLConnection.HTTP_FORBIDDEN) {
|
||||
} else if (connection.getResponseCode() == HttpURLConnection.HTTP_INTERNAL_ERROR || connection.getResponseCode() == HttpURLConnection.HTTP_FORBIDDEN) {
|
||||
// GitHub is down or we hit a local rate limit
|
||||
return new RemoteVersion(BranchStatus.ERROR);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user