revert(房间): 退出房间清空缓存回滚
This commit is contained in:
parent
c11f1987db
commit
743694f106
@ -1,13 +1,11 @@
|
|||||||
package com.red.circle.live.app.command.user;
|
package com.red.circle.live.app.command.user;
|
||||||
|
|
||||||
import com.red.circle.common.business.dto.cmd.app.AppRoomIdCmd;
|
import com.red.circle.common.business.dto.cmd.app.AppRoomIdCmd;
|
||||||
import com.red.circle.component.redis.service.RedisService;
|
|
||||||
import com.red.circle.live.domain.gateway.LiveMicrophoneGateway;
|
import com.red.circle.live.domain.gateway.LiveMicrophoneGateway;
|
||||||
import com.red.circle.live.domain.live.LiveMicrophone;
|
import com.red.circle.live.domain.live.LiveMicrophone;
|
||||||
import com.red.circle.live.domain.live.LiveMusicStatus;
|
import com.red.circle.live.domain.live.LiveMusicStatus;
|
||||||
import com.red.circle.live.infra.database.cache.service.LiveMicCacheService;
|
import com.red.circle.live.infra.database.cache.service.LiveMicCacheService;
|
||||||
import com.red.circle.live.infra.database.cache.service.LiveMusicHeartbeatService;
|
import com.red.circle.live.infra.database.cache.service.LiveMusicHeartbeatService;
|
||||||
import com.red.circle.other.inner.endpoint.user.region.UserRegionClient;
|
|
||||||
import com.red.circle.tool.core.collection.CollectionUtils;
|
import com.red.circle.tool.core.collection.CollectionUtils;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@ -26,8 +24,6 @@ public class LiveQuitRoomExe {
|
|||||||
private final LiveMicCacheService liveMicCacheService;
|
private final LiveMicCacheService liveMicCacheService;
|
||||||
private final LiveMicrophoneGateway liveMicrophoneGateway;
|
private final LiveMicrophoneGateway liveMicrophoneGateway;
|
||||||
private final LiveMusicHeartbeatService liveMusicHeartbeatService;
|
private final LiveMusicHeartbeatService liveMusicHeartbeatService;
|
||||||
private final UserRegionClient userRegionClient;
|
|
||||||
private final RedisService redisService;
|
|
||||||
|
|
||||||
public void execute(AppRoomIdCmd cmd) {
|
public void execute(AppRoomIdCmd cmd) {
|
||||||
// 移除在线用户
|
// 移除在线用户
|
||||||
@ -54,16 +50,6 @@ public class LiveQuitRoomExe {
|
|||||||
&& Objects.equals(musicStatus.getUserId(), cmd.requiredReqUserId())) {
|
&& Objects.equals(musicStatus.getUserId(), cmd.requiredReqUserId())) {
|
||||||
liveMusicHeartbeatService.removeMickUser(cmd.getRoomId());
|
liveMusicHeartbeatService.removeMickUser(cmd.getRoomId());
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
|
||||||
//清空房间列表缓存
|
|
||||||
String region = userRegionClient.getRegionCode(cmd.requiredReqUserId()).getBody();
|
|
||||||
String key = cmd.requireReqSysOrigin() + region;
|
|
||||||
redisService.delete("USER:REGION_ROOM:" + key);
|
|
||||||
} catch (Exception e) {
|
|
||||||
// ignore
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user