- if(!configsToPush.isEmpty()) {
- pusher.pushConfigs(new ArrayList<ConfigSnapshotHolder>(configsToPush));
+ if (!configsToPush.isEmpty()) {
+
+ // Ignore features that are present in persisted current config
+ final Optional<XmlFileStorageAdapter> currentCfgPusher = XmlFileStorageAdapter.getInstance();
+ if (currentCfgPusher.isPresent() &&
+ currentCfgPusher.get().getPersistedFeatures().contains(feature.getId())) {
+ LOG.warn("Ignoring default configuration {} for feature {}, the configuration is present in {}",
+ configsToPush, feature.getId(), currentCfgPusher.get());
+ } else {
+ pusher.pushConfigs(new ArrayList<ConfigSnapshotHolder>(configsToPush));
+ }
+