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?
|
// Locally built?
|
||||||
pendingReleaseFuture.complete(cachedRelease = new RemoteVersion(BranchStatus.UNKNOWN));
|
pendingReleaseFuture.complete(cachedRelease = new RemoteVersion(BranchStatus.UNKNOWN));
|
||||||
break catchBlock;
|
break catchBlock;
|
||||||
}
|
} else if (connection.getResponseCode() == HttpURLConnection.HTTP_INTERNAL_ERROR || connection.getResponseCode() == HttpURLConnection.HTTP_FORBIDDEN) {
|
||||||
if (connection.getResponseCode() == HttpURLConnection.HTTP_INTERNAL_ERROR) {
|
// GitHub is down or rate limit exceeded
|
||||||
// Github is down
|
|
||||||
pendingReleaseFuture.complete(new RemoteVersion(BranchStatus.ERROR));
|
pendingReleaseFuture.complete(new RemoteVersion(BranchStatus.ERROR));
|
||||||
break catchBlock;
|
break catchBlock;
|
||||||
}
|
}
|
||||||
@ -146,8 +145,7 @@ public final class UpdateChecker {
|
|||||||
if (connection.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
|
if (connection.getResponseCode() == HttpURLConnection.HTTP_NOT_FOUND) {
|
||||||
// Locally built?
|
// Locally built?
|
||||||
return new RemoteVersion(BranchStatus.UNKNOWN);
|
return new RemoteVersion(BranchStatus.UNKNOWN);
|
||||||
}
|
} else if (connection.getResponseCode() == HttpURLConnection.HTTP_INTERNAL_ERROR || connection.getResponseCode() == HttpURLConnection.HTTP_FORBIDDEN) {
|
||||||
if (connection.getResponseCode() == HttpURLConnection.HTTP_INTERNAL_ERROR || connection.getResponseCode() == HttpURLConnection.HTTP_FORBIDDEN) {
|
|
||||||
// GitHub is down or we hit a local rate limit
|
// GitHub is down or we hit a local rate limit
|
||||||
return new RemoteVersion(BranchStatus.ERROR);
|
return new RemoteVersion(BranchStatus.ERROR);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user