File tree Expand file tree Collapse file tree
Essentials/src/main/java/com/earth2me/essentials/updatecheck Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,11 +76,11 @@ public CompletableFuture<RemoteVersion> fetchLatestDev() {
7676 return pendingDevFuture ;
7777 }
7878 pendingDevFuture = new CompletableFuture <>();
79- new Thread (() -> {
79+ ess . runTaskAsynchronously (() -> {
8080 pendingDevFuture .complete (cachedDev = fetchDistance (BRANCH , getVersionIdentifier ()));
8181 pendingDevFuture = null ;
8282 lastFetchTime = System .currentTimeMillis ();
83- }). start () ;
83+ });
8484 return pendingDevFuture ;
8585 }
8686 return CompletableFuture .completedFuture (cachedDev );
@@ -92,7 +92,7 @@ public CompletableFuture<RemoteVersion> fetchLatestRelease() {
9292 return pendingReleaseFuture ;
9393 }
9494 pendingReleaseFuture = new CompletableFuture <>();
95- new Thread (() -> {
95+ ess . runTaskAsynchronously (() -> {
9696 catchBlock :
9797 try {
9898 final HttpURLConnection connection = tryRequestWithFallback (LATEST_RELEASE_URL , LATEST_RELEASE_PROXY_URL );
@@ -120,7 +120,7 @@ public CompletableFuture<RemoteVersion> fetchLatestRelease() {
120120 }
121121 pendingReleaseFuture = null ;
122122 lastFetchTime = System .currentTimeMillis ();
123- }). start () ;
123+ });
124124 return pendingReleaseFuture ;
125125 }
126126 return CompletableFuture .completedFuture (cachedRelease );
You can’t perform that action at this time.
0 commit comments