提交 c35c6f2a 编写于 作者: Z zhang-wei 提交者: wu-sheng

fix consul repeated invoker KVCache.newCache (#3833)

上级 f4e0f221
......@@ -93,7 +93,10 @@ public class ConsulConfigurationWatcherRegister extends ConfigWatcherRegister {
}
private void registerKeyListeners(final Set<String> keys) {
keys.forEach(key -> {
final Set<String> unregisterKeys = new HashSet<>(keys);
unregisterKeys.removeAll(cachesByKey.keySet());
unregisterKeys.forEach(key -> {
KVCache cache = KVCache.newCache(consul, key);
cache.addListener(newValues -> {
Optional<Value> value = newValues.values().stream().filter(it -> key.equals(it.getKey())).findAny();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册