定时上麦记录bug
This commit is contained in:
@@ -342,7 +342,7 @@ public class GuildMemberRoomMicRecordService extends ServiceImpl<GuildMemberRoom
|
|||||||
MicRecordVo micRecordVo = micRecordMap.get(uid);
|
MicRecordVo micRecordVo = micRecordMap.get(uid);
|
||||||
if (ObjectUtil.isNull(micRecordVo)) {
|
if (ObjectUtil.isNull(micRecordVo)) {
|
||||||
micRecordMap.remove(uid);
|
micRecordMap.remove(uid);
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
Long roomId = micRecordVo.getRoomId();
|
Long roomId = micRecordVo.getRoomId();
|
||||||
Integer pos = micRecordVo.getPos();
|
Integer pos = micRecordVo.getPos();
|
||||||
@@ -351,13 +351,13 @@ public class GuildMemberRoomMicRecordService extends ServiceImpl<GuildMemberRoom
|
|||||||
PlayRoomVo playRoomVo = roomMicMap.get(roomUid);
|
PlayRoomVo playRoomVo = roomMicMap.get(roomUid);
|
||||||
if (playRoomVo == null || CollectionUtils.isEmpty(playRoomVo.getMicUsers())) {
|
if (playRoomVo == null || CollectionUtils.isEmpty(playRoomVo.getMicUsers())) {
|
||||||
micRecordMap.remove(uid);
|
micRecordMap.remove(uid);
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<Long> micUids = playRoomVo.getMicUsers().stream().map(MicUserVo::getUid).collect(Collectors.toSet());
|
Set<Long> micUids = playRoomVo.getMicUsers().stream().map(MicUserVo::getUid).collect(Collectors.toSet());
|
||||||
if (!micUids.contains(uid)) {
|
if (!micUids.contains(uid)) {
|
||||||
micRecordMap.remove(uid);
|
micRecordMap.remove(uid);
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
RLock lock = redissonClient.getLock(RedisKey.guild_member_room_mic_record_lock.getKey(uid.toString(), roomId.toString(), pos.toString()));
|
RLock lock = redissonClient.getLock(RedisKey.guild_member_room_mic_record_lock.getKey(uid.toString(), roomId.toString(), pos.toString()));
|
||||||
@@ -367,19 +367,19 @@ public class GuildMemberRoomMicRecordService extends ServiceImpl<GuildMemberRoom
|
|||||||
GuildMember guildMember = guildMemberMap.get(micRecordVo.getUid());
|
GuildMember guildMember = guildMemberMap.get(micRecordVo.getUid());
|
||||||
if (ObjectUtil.isNull(guildMember)) {
|
if (ObjectUtil.isNull(guildMember)) {
|
||||||
micRecordMap.remove(uid);
|
micRecordMap.remove(uid);
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
RSet<Long> micSet = redissonClient.getSet(RedisKey.guild_member_room_mic_record.getKey(uid.toString(), roomId.toString(), pos.toString()));
|
RSet<Long> micSet = redissonClient.getSet(RedisKey.guild_member_room_mic_record.getKey(uid.toString(), roomId.toString(), pos.toString()));
|
||||||
Optional<Long> lastUpMic = micSet.stream().filter(inTime -> timeInMillis.compareTo(inTime) > 0).max(Comparator.comparingLong(Long::longValue));
|
Optional<Long> lastUpMic = micSet.stream().filter(inTime -> timeInMillis.compareTo(inTime) > 0).max(Comparator.comparingLong(Long::longValue));
|
||||||
if (lastUpMic.isEmpty()) {
|
if (lastUpMic.isEmpty()) {
|
||||||
log.error("[statMicRecordTask] 获取上麦时间异常 uid {} roomUid {} roomId {} pos {} timeInMillis {}", uid, roomId, pos, timeInMillis);
|
log.error("[statMicRecordTask] 获取上麦时间异常 uid {} roomUid {} roomId {} pos {} timeInMillis {}", uid, roomId, pos, timeInMillis);
|
||||||
micRecordMap.remove(uid);
|
micRecordMap.remove(uid);
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
Long maxUpTime = lastUpMic.get();
|
Long maxUpTime = lastUpMic.get();
|
||||||
if (maxUpTime == null) {
|
if (maxUpTime == null) {
|
||||||
micRecordMap.remove(uid);
|
micRecordMap.remove(uid);
|
||||||
return;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Integer partitionId = guildMember.getPartitionId();
|
Integer partitionId = guildMember.getPartitionId();
|
||||||
|
Reference in New Issue
Block a user