fix: Shutdown room tasks when terminal too small
This commit is contained in:
@@ -109,6 +109,7 @@ public class FullRoomDrawHandler extends AbstractEventHandler<FullRoomDraw> {
|
|||||||
// Screen too small to fit the room
|
// Screen too small to fit the room
|
||||||
eventManager.emitEvent(new TerminalTooSmallEvent());
|
eventManager.emitEvent(new TerminalTooSmallEvent());
|
||||||
renderState.setTerminalTooSmall(true);
|
renderState.setTerminalTooSmall(true);
|
||||||
|
roomTaskScheduler.shutdownTasks();
|
||||||
//log.error("Terminal too small", e);
|
//log.error("Terminal too small", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,12 @@ public class RoomTaskScheduler {
|
|||||||
scheduler = Executors.newScheduledThreadPool(threadPoolConfig.getTaskThreadCount());
|
scheduler = Executors.newScheduledThreadPool(threadPoolConfig.getTaskThreadCount());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void shutdownTasks() {
|
||||||
|
shutdownAll();
|
||||||
|
initExecutor();
|
||||||
|
firstRun = true;
|
||||||
|
}
|
||||||
|
|
||||||
private void shutdownAll() {
|
private void shutdownAll() {
|
||||||
scheduler.shutdown();
|
scheduler.shutdown();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user