修复未加入房间,恢复可用机器人数
parent
552620e486
commit
dda674af58
|
|
@ -171,8 +171,9 @@ public class RoomWanfaMatcher {
|
||||||
//检查调度器是否可用
|
//检查调度器是否可用
|
||||||
if (!scheduler.isShutdown()) {
|
if (!scheduler.isShutdown()) {
|
||||||
CompletableFuture.runAsync(() -> {
|
CompletableFuture.runAsync(() -> {
|
||||||
|
RobotInfo robot = null;
|
||||||
try {
|
try {
|
||||||
RobotInfo robot = robotManager.getLoggedInRobotForWanfa(wanfaId);
|
robot = robotManager.getLoggedInRobotForWanfa(wanfaId);
|
||||||
//加入房间
|
//加入房间
|
||||||
GroupRoomBusiness.joinRoom(group, roomId, robot.getSession(), null);
|
GroupRoomBusiness.joinRoom(group, roomId, robot.getSession(), null);
|
||||||
|
|
||||||
|
|
@ -185,6 +186,9 @@ public class RoomWanfaMatcher {
|
||||||
robotConnectionHandler.readyTimeRobotExit(robot);
|
robotConnectionHandler.readyTimeRobotExit(robot);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
if (robot != null) {
|
||||||
|
robotConnectionHandler.disconnectRobot(robot.getRobotId());
|
||||||
|
}
|
||||||
log.error("机器人加入房间时发生错误: groupId={}, roomId={}, wanfaId={}, isRobot={}", group, roomId, wanfaId, isRobot, e);
|
log.error("机器人加入房间时发生错误: groupId={}, roomId={}, wanfaId={}, isRobot={}", group, roomId, wanfaId, isRobot, e);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue