定时任务-刷新房间人数-去掉cdl
This commit is contained in:
@@ -36,17 +36,13 @@ public class RefreshPersonTask extends BaseTask {
|
||||
List<RoomVo> roomList = roomService.getHomeRunningRoomList();
|
||||
List<List<RoomVo>> partitionList = Lists.partition(roomList, 12);
|
||||
for (List<RoomVo> list: partitionList){
|
||||
CountDownLatch cdl = new CountDownLatch(list.size());
|
||||
bizExecutor.execute(()->{
|
||||
try {
|
||||
roomService.scanRoomOnline(list);
|
||||
} catch (Exception e) {
|
||||
log.error("更新房间人数失败, list:{}", JSON.toJSONString(list), e);
|
||||
} finally {
|
||||
cdl.countDown();
|
||||
}
|
||||
});
|
||||
cdl.await();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user