ConfigManager: don't post an update if the values are the same (#5480)
- Don't post config update if the values changed are the same - Don't post unset if value is already null
This commit is contained in:
@@ -237,9 +237,9 @@ public class ConfigManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
T t = (T) Proxy.newProxyInstance(clazz.getClassLoader(), new Class<?>[]
|
T t = (T) Proxy.newProxyInstance(clazz.getClassLoader(), new Class<?>[]
|
||||||
{
|
{
|
||||||
clazz
|
clazz
|
||||||
}, handler);
|
}, handler);
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
@@ -277,6 +277,11 @@ public class ConfigManager
|
|||||||
|
|
||||||
String oldValue = (String) properties.setProperty(groupName + "." + key, value);
|
String oldValue = (String) properties.setProperty(groupName + "." + key, value);
|
||||||
|
|
||||||
|
if (Objects.equals(oldValue, value))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (client != null)
|
if (client != null)
|
||||||
{
|
{
|
||||||
client.set(groupName + "." + key, value);
|
client.set(groupName + "." + key, value);
|
||||||
@@ -315,6 +320,11 @@ public class ConfigManager
|
|||||||
|
|
||||||
String oldValue = (String) properties.remove(groupName + "." + key);
|
String oldValue = (String) properties.remove(groupName + "." + key);
|
||||||
|
|
||||||
|
if (oldValue == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (client != null)
|
if (client != null)
|
||||||
{
|
{
|
||||||
client.unset(groupName + "." + key);
|
client.unset(groupName + "." + key);
|
||||||
|
|||||||
Reference in New Issue
Block a user