紧急修复麦位
This commit is contained in:
parent
5339742f69
commit
096e37612e
@ -307,21 +307,24 @@ public class UserHeartbeatListener implements MessageListener {
|
|||||||
? checkedChannelState
|
? checkedChannelState
|
||||||
: agoraRoomStateService.getChannelState(roomProfile.getId());
|
: agoraRoomStateService.getChannelState(roomProfile.getId());
|
||||||
if (!channelState.querySuccess()) {
|
if (!channelState.querySuccess()) {
|
||||||
log.warn("心跳刷新麦位跳过,声网查询失败 roomId={}, userId={}, response={}",
|
log.warn("心跳刷新麦位声网查询失败,降级刷新业务麦位 roomId={}, userId={}, response={}",
|
||||||
roomProfile.getId(), userProfile.getId(), channelState.getRawResponse());
|
roomProfile.getId(), userProfile.getId(), channelState.getRawResponse());
|
||||||
liveMicrophoneGateway.refreshNotActiveUser(roomProfile);
|
refreshMicActiveTimeWithoutAgoraCheck(event, roomProfile, liveMicrophone);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Long agoraUid = DataTypeUtils.toLong(userProfile.getAccount());
|
if (!isUserInAgoraChannel(channelState, userProfile)) {
|
||||||
if (!channelState.channelExist() || Objects.isNull(agoraUid)
|
|
||||||
|| CollectionUtils.isEmpty(channelState.getBroadcasters())
|
|
||||||
|| !channelState.getBroadcasters().contains(agoraUid)) {
|
|
||||||
agoraMicStateCleanupService.cleanupUser(roomProfile.getId(), userProfile.getId(),
|
agoraMicStateCleanupService.cleanupUser(roomProfile.getId(), userProfile.getId(),
|
||||||
"heartbeat agora broadcaster missing");
|
"heartbeat agora user missing");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
refreshMicActiveTimeWithoutAgoraCheck(event, roomProfile, liveMicrophone);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void refreshMicActiveTimeWithoutAgoraCheck(UserHeartbeatEvent event,
|
||||||
|
RoomProfileDTO roomProfile,
|
||||||
|
LiveMicrophone liveMicrophone) {
|
||||||
// 刷新活跃时间
|
// 刷新活跃时间
|
||||||
if (liveMicCacheService.checkLockMic(roomProfile.getId(), liveMicrophone.getMicIndex())) {
|
if (liveMicCacheService.checkLockMic(roomProfile.getId(), liveMicrophone.getMicIndex())) {
|
||||||
event.setRetryRefreshMick(true);
|
event.setRetryRefreshMick(true);
|
||||||
|
|||||||
@ -72,15 +72,21 @@ public class AgoraMicStateReconcileTask {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Set<Long> broadcasterUids = new HashSet<>(state.getBroadcasters());
|
Set<Long> channelUids = new HashSet<>();
|
||||||
|
if (CollectionUtils.isNotEmpty(state.getBroadcasters())) {
|
||||||
|
channelUids.addAll(state.getBroadcasters());
|
||||||
|
}
|
||||||
|
if (CollectionUtils.isNotEmpty(state.getAudience())) {
|
||||||
|
channelUids.addAll(state.getAudience());
|
||||||
|
}
|
||||||
for (LiveMicrophone microphone : microphones) {
|
for (LiveMicrophone microphone : microphones) {
|
||||||
if (Objects.isNull(microphone) || Objects.isNull(microphone.getUser())) {
|
if (Objects.isNull(microphone) || Objects.isNull(microphone.getUser())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Long agoraUid = DataTypeUtils.toLong(microphone.getUser().getAccount());
|
Long agoraUid = DataTypeUtils.toLong(microphone.getUser().getAccount());
|
||||||
if (Objects.isNull(agoraUid) || !broadcasterUids.contains(agoraUid)) {
|
if (Objects.isNull(agoraUid) || !channelUids.contains(agoraUid)) {
|
||||||
agoraMicStateCleanupService.cleanupUser(roomId, microphone.getUser().getId(),
|
agoraMicStateCleanupService.cleanupUser(roomId, microphone.getUser().getId(),
|
||||||
"reconcile agora broadcaster missing");
|
"reconcile agora user missing");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user