adjust max tourney limit ratio

better alignment for small servers focusing on limited play
This commit is contained in:
xenohedron 2024-05-21 00:40:38 -04:00
parent 0f858fe3c3
commit 51546e7c78

View file

@ -15,8 +15,8 @@ public class ThreadExecutorImpl implements ThreadExecutor {
private static final Logger logger = Logger.getLogger(ThreadExecutorImpl.class); private static final Logger logger = Logger.getLogger(ThreadExecutorImpl.class);
// used for max tourney limit, but without new config setting // used for max tourney limit, but without new config setting
// example: server can have 100 games and 10 tourney at a time // example: server can have 50 games and 10 tourney at a time
private final int GAMES_PER_TOURNEY_RATIO = 100 / 10; 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 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) 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() { CachedThreadPoolWithException() {
// use same params as Executors.newCachedThreadPool() // use same params as Executors.newCachedThreadPool()
super(0, Integer.MAX_VALUE,60L, TimeUnit.SECONDS, new SynchronousQueue<Runnable>()); super(0, Integer.MAX_VALUE,60L, TimeUnit.SECONDS, new SynchronousQueue<>());
} }
@Override @Override
@ -91,7 +91,7 @@ public class ThreadExecutorImpl implements ThreadExecutor {
FixedThreadPoolWithException(int nThreads) { FixedThreadPoolWithException(int nThreads) {
// use same params as Executors.newFixedThreadPool() // use same params as Executors.newFixedThreadPool()
super(nThreads, nThreads,0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>()); super(nThreads, nThreads,0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>());
} }
@Override @Override