fix the conditions for resetting uuid in dynamic configuration (#588)

This commit is contained in:
xzyJavaX 2023-07-29 03:29:17 +08:00 committed by GitHub
parent 6baa4a7baa
commit c38a19c6c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -149,6 +149,7 @@ Callable {
* Upgrade guava to 32.0.1
* Fix issue with duplicate enhancement by ThreadPoolExecutor
* Add plugin to support for RESTeasy 6.x.
* Fix the conditions for resetting uuid, avoid the same uuid causing the configuration not to be updated.
#### Documentation

View File

@ -219,7 +219,7 @@ public class ConfigurationDiscoveryService implements BootService, GRPCChannelLi
builder.setService(Config.Agent.SERVICE_NAME);
// Some plugin will register watcher later.
final int size = register.keys().size();
final int size = register.getRegisterWatcherSize();
if (lastRegisterWatcherSize != size) {
// reset uuid, avoid the same uuid causing the configuration not to be updated.
uuid = null;
@ -273,6 +273,12 @@ public class ConfigurationDiscoveryService implements BootService, GRPCChannelLi
return register.keySet();
}
public int getRegisterWatcherSize() {
return register.values().stream()
.mapToInt(List::size)
.sum();
}
@Override
public String toString() {
ArrayList<String> registerTableDescription = new ArrayList<>(register.size());