mirror of
https://github.com/EssentialsX/Essentials.git
synced 2025-01-05 07:57:59 +01:00
parent
997fb1800e
commit
695546420f
@ -76,11 +76,11 @@ public final class UpdateChecker {
|
|||||||
return pendingDevFuture;
|
return pendingDevFuture;
|
||||||
}
|
}
|
||||||
pendingDevFuture = new CompletableFuture<>();
|
pendingDevFuture = new CompletableFuture<>();
|
||||||
new Thread(() -> {
|
ess.runTaskAsynchronously(() -> {
|
||||||
pendingDevFuture.complete(cachedDev = fetchDistance(BRANCH, getVersionIdentifier()));
|
pendingDevFuture.complete(cachedDev = fetchDistance(BRANCH, getVersionIdentifier()));
|
||||||
pendingDevFuture = null;
|
pendingDevFuture = null;
|
||||||
lastFetchTime = System.currentTimeMillis();
|
lastFetchTime = System.currentTimeMillis();
|
||||||
}).start();
|
});
|
||||||
return pendingDevFuture;
|
return pendingDevFuture;
|
||||||
}
|
}
|
||||||
return CompletableFuture.completedFuture(cachedDev);
|
return CompletableFuture.completedFuture(cachedDev);
|
||||||
@ -92,7 +92,7 @@ public final class UpdateChecker {
|
|||||||
return pendingReleaseFuture;
|
return pendingReleaseFuture;
|
||||||
}
|
}
|
||||||
pendingReleaseFuture = new CompletableFuture<>();
|
pendingReleaseFuture = new CompletableFuture<>();
|
||||||
new Thread(() -> {
|
ess.runTaskAsynchronously(() -> {
|
||||||
catchBlock:
|
catchBlock:
|
||||||
try {
|
try {
|
||||||
final HttpURLConnection connection = tryRequestWithFallback(LATEST_RELEASE_URL, LATEST_RELEASE_PROXY_URL);
|
final HttpURLConnection connection = tryRequestWithFallback(LATEST_RELEASE_URL, LATEST_RELEASE_PROXY_URL);
|
||||||
@ -120,7 +120,7 @@ public final class UpdateChecker {
|
|||||||
}
|
}
|
||||||
pendingReleaseFuture = null;
|
pendingReleaseFuture = null;
|
||||||
lastFetchTime = System.currentTimeMillis();
|
lastFetchTime = System.currentTimeMillis();
|
||||||
}).start();
|
});
|
||||||
return pendingReleaseFuture;
|
return pendingReleaseFuture;
|
||||||
}
|
}
|
||||||
return CompletableFuture.completedFuture(cachedRelease);
|
return CompletableFuture.completedFuture(cachedRelease);
|
||||||
|
Loading…
Reference in New Issue
Block a user