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
|
||||
eventManager.emitEvent(new TerminalTooSmallEvent());
|
||||
renderState.setTerminalTooSmall(true);
|
||||
roomTaskScheduler.shutdownTasks();
|
||||
//log.error("Terminal too small", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,12 @@ public class RoomTaskScheduler {
|
||||
scheduler = Executors.newScheduledThreadPool(threadPoolConfig.getTaskThreadCount());
|
||||
}
|
||||
|
||||
public void shutdownTasks() {
|
||||
shutdownAll();
|
||||
initExecutor();
|
||||
firstRun = true;
|
||||
}
|
||||
|
||||
private void shutdownAll() {
|
||||
scheduler.shutdown();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user