fix: Shutdown room tasks when terminal too small

This commit is contained in:
2026-01-02 13:16:00 +01:00
parent 84f757a70e
commit b355ae1dd2
2 changed files with 7 additions and 0 deletions

View File

@@ -109,6 +109,7 @@ public class FullRoomDrawHandler extends AbstractEventHandler<FullRoomDraw> {
// Screen too small to fit the room
eventManager.emitEvent(new TerminalTooSmallEvent());
renderState.setTerminalTooSmall(true);
roomTaskScheduler.shutdownTasks();
//log.error("Terminal too small", e);
}
}

View File

@@ -34,6 +34,12 @@ public class RoomTaskScheduler {
scheduler = Executors.newScheduledThreadPool(threadPoolConfig.getTaskThreadCount());
}
public void shutdownTasks() {
shutdownAll();
initExecutor();
firstRun = true;
}
private void shutdownAll() {
scheduler.shutdown();