Centralized executor

This commit is contained in:
Anuken
2022-04-13 17:38:18 -04:00
parent c01348af29
commit 4b5d833c74
9 changed files with 13 additions and 18 deletions
+1 -3
View File
@@ -17,7 +17,6 @@ import mindustry.ui.dialogs.*;
import java.io.*;
import java.net.*;
import java.util.concurrent.*;
import static mindustry.Vars.*;
@@ -25,7 +24,6 @@ import static mindustry.Vars.*;
public class BeControl{
private static final int updateInterval = 60;
private ExecutorService executor = Threads.executor(1);
private boolean checkUpdates = true;
private boolean updateAvailable;
private String updateUrl;
@@ -168,7 +166,7 @@ public class BeControl{
}
private void download(String furl, Fi dest, Intc length, Floatc progressor, Boolp canceled, Runnable done, Cons<Throwable> error){
executor.submit(() -> {
mainExecutor.submit(() -> {
try{
HttpURLConnection con = (HttpURLConnection)new URL(furl).openConnection();
BufferedInputStream in = new BufferedInputStream(con.getInputStream());