diff --git a/redis/redis-proxy-client/src/main/java/com/ctrip/framework/xpipe/redis/utils/ProxyUtil.java b/redis/redis-proxy-client/src/main/java/com/ctrip/framework/xpipe/redis/utils/ProxyUtil.java index 589a84bb6..b932804a7 100644 --- a/redis/redis-proxy-client/src/main/java/com/ctrip/framework/xpipe/redis/utils/ProxyUtil.java +++ b/redis/redis-proxy-client/src/main/java/com/ctrip/framework/xpipe/redis/utils/ProxyUtil.java @@ -30,8 +30,8 @@ public static ProxyUtil getInstance() { public synchronized void registerProxy(String ip, int port, String routeInfo) { InetSocketAddress address = new InetSocketAddress(ip, port); - if (get(address) != null) { - ProxyResourceManager oldProxyResourceManager = get(address); + ProxyResourceManager oldProxyResourceManager = get(address); + if (oldProxyResourceManager != null) { removeManagerProxy(oldProxyResourceManager); } put(address, getProxyProtocol(ip, port, routeInfo));