From 51546e7c78cbcb3a6e9f27d79f874a632cab3b2e Mon Sep 17 00:00:00 2001 From: xenohedron Date: Tue, 21 May 2024 00:40:38 -0400 Subject: [PATCH] adjust max tourney limit ratio better alignment for small servers focusing on limited play --- .../main/java/mage/server/util/ThreadExecutorImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Mage.Server/src/main/java/mage/server/util/ThreadExecutorImpl.java b/Mage.Server/src/main/java/mage/server/util/ThreadExecutorImpl.java index 0ce8aa2bb9e..a3e8e1a3427 100644 --- a/Mage.Server/src/main/java/mage/server/util/ThreadExecutorImpl.java +++ b/Mage.Server/src/main/java/mage/server/util/ThreadExecutorImpl.java @@ -15,8 +15,8 @@ public class ThreadExecutorImpl implements ThreadExecutor { private static final Logger logger = Logger.getLogger(ThreadExecutorImpl.class); // used for max tourney limit, but without new config setting - // example: server can have 100 games and 10 tourney at a time - private final int GAMES_PER_TOURNEY_RATIO = 100 / 10; + // example: server can have 50 games and 10 tourney at a time + private static final int GAMES_PER_TOURNEY_RATIO = 50 / 10; private final ExecutorService callExecutor; // shareable threads to run single task (example: save new game settings from a user, send chat message, etc) private final ExecutorService gameExecutor; // game threads to run long tasks, one per game (example: run game and wait user's feedback) @@ -72,7 +72,7 @@ public class ThreadExecutorImpl implements ThreadExecutor { CachedThreadPoolWithException() { // use same params as Executors.newCachedThreadPool() - super(0, Integer.MAX_VALUE,60L, TimeUnit.SECONDS, new SynchronousQueue()); + super(0, Integer.MAX_VALUE,60L, TimeUnit.SECONDS, new SynchronousQueue<>()); } @Override @@ -91,7 +91,7 @@ public class ThreadExecutorImpl implements ThreadExecutor { FixedThreadPoolWithException(int nThreads) { // use same params as Executors.newFixedThreadPool() - super(nThreads, nThreads,0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue()); + super(nThreads, nThreads,0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>()); } @Override