[集群-自动切换过国标级联] 修复BUG

This commit is contained in:
648540858
2025-01-02 17:26:50 +08:00
parent ea2ef923ac
commit 0566bf916f
4 changed files with 6 additions and 4 deletions

View File

@@ -191,7 +191,7 @@ public interface IRedisCatchStorage {
ServerInfo queryServerInfo(String serverId);
String chooseOneServer();
String chooseOneServer(String serverId);
}

View File

@@ -545,8 +545,9 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage {
}
@Override
public String chooseOneServer() {
public String chooseOneServer(String serverId) {
String key = VideoManagerConstants.WVP_SERVER_LIST;
redisTemplate.opsForZSet().remove(key, serverId);
Set<Object> range = redisTemplate.opsForZSet().range(key, 0, 0);
if (range == null || range.isEmpty()) {
return null;