Solve Conflict

This commit is contained in:
KomachiSion 2021-04-13 14:44:21 +08:00
parent 51cc2b1b4b
commit 77990982ef
4 changed files with 9 additions and 3 deletions

View File

@ -34,6 +34,7 @@ import com.alibaba.nacos.client.config.utils.ParamUtils;
import com.alibaba.nacos.client.utils.LogUtils;
import com.alibaba.nacos.client.utils.ParamUtil;
import com.alibaba.nacos.client.utils.ValidatorUtils;
import com.alibaba.nacos.common.utils.StringUtils;
import org.slf4j.Logger;
import java.util.Arrays;

View File

@ -25,6 +25,7 @@ import com.alibaba.nacos.client.config.filter.impl.ConfigFilterChainManager;
import com.alibaba.nacos.client.config.filter.impl.ConfigResponse;
import com.alibaba.nacos.client.config.listener.impl.AbstractConfigChangeListener;
import com.alibaba.nacos.client.utils.LogUtils;
import com.alibaba.nacos.client.utils.TenantUtil;
import com.alibaba.nacos.common.utils.MD5Utils;
import org.slf4j.Logger;

View File

@ -100,7 +100,7 @@ public class ClientWorker implements Closeable {
* @param listeners listeners
*/
public void addListeners(String dataId, String group, List<? extends Listener> listeners) {
group = null2defaultGroup(group);
group = blank2defaultGroup(group);
CacheData cache = addCacheDataIfAbsent(dataId, group);
synchronized (cache) {
@ -169,7 +169,7 @@ public class ClientWorker implements Closeable {
* @param listener listener
*/
public void removeListener(String dataId, String group, Listener listener) {
group = null2defaultGroup(group);
group = blank2defaultGroup(group);
CacheData cache = getCache(dataId, group);
if (null != cache) {
synchronized (cache) {
@ -349,6 +349,10 @@ public class ClientWorker implements Closeable {
return cache;
}
public CacheData getCache(String dataId, String group) {
return getCache(dataId, group, TenantUtil.getUserTenantForAcm());
}
public CacheData getCache(String dataId, String group, String tenant) {
if (null == dataId || null == group) {
throw new IllegalArgumentException();

View File

@ -280,7 +280,7 @@ public class UdpPushService implements ApplicationContextAware, ApplicationListe
}
public static String getPushCacheKey(String serviceName, String clientIP, String agent) {
return serviceName + UtilsAndCommons.CACHE_KEY_SPLITER + agent;
return serviceName + UtilsAndCommons.CACHE_KEY_SPLITTER + agent;
}
/**