Use a cached thread pool instead of a fixed size thread pool

This commit is contained in:
0xb00bface 2021-01-23 10:23:20 +01:00
parent 326f970aa5
commit 508a25f3b5
1 changed files with 1 additions and 1 deletions

View File

@ -8,7 +8,7 @@ import java.util.concurrent.Future;
public class GlobalThreadPool {
private static ExecutorService threadPool = Executors.newFixedThreadPool(30, r -> {
private static ExecutorService threadPool = Executors.newCachedThreadPool(r -> {
Thread t = new Thread(r);
t.setDaemon(true);
t.setName("GlobalWorker-" + UUID.randomUUID().toString().substring(0, 8));