Skip to content

Commit 84b262d

Browse files
committed
rollback
1 parent 79294f7 commit 84b262d

File tree

1 file changed

+2
-29
lines changed
  • remote-config/remote-config-core/src/main/java/datadog/remoteconfig/state

1 file changed

+2
-29
lines changed

remote-config/remote-config-core/src/main/java/datadog/remoteconfig/state/ProductState.java

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,8 @@ public boolean apply(
5858
errors = null;
5959

6060
List<ParsedConfigKey> configBeenUsedByProduct = new ArrayList<>();
61-
List<ParsedConfigKey> changedKeys = new ArrayList<>();
6261
boolean changesDetected = false;
6362

64-
// Step 1: Detect all changes
6563
for (ParsedConfigKey configKey : relevantKeys) {
6664
try {
6765
RemoteConfigResponse.Targets.ConfigTarget target =
@@ -70,26 +68,14 @@ public boolean apply(
7068

7169
if (isTargetChanged(configKey, target)) {
7270
changesDetected = true;
73-
changedKeys.add(configKey);
74-
}
75-
} catch (ReportableException e) {
76-
recordError(e);
77-
}
78-
}
79-
80-
// Step 2: For products other than ASM_DD, apply changes immediately
81-
if (product != Product.ASM_DD) {
82-
for (ParsedConfigKey configKey : changedKeys) {
83-
try {
8471
byte[] content = getTargetFileContent(fleetResponse, configKey);
8572
callListenerApplyTarget(fleetResponse, hinter, configKey, content);
86-
} catch (ReportableException e) {
87-
recordError(e);
8873
}
74+
} catch (ReportableException e) {
75+
recordError(e);
8976
}
9077
}
9178

92-
// Step 3: Remove obsolete configurations (for all products)
9379
List<ParsedConfigKey> keysToRemove =
9480
cachedTargetFiles.keySet().stream()
9581
.filter(configKey -> !configBeenUsedByProduct.contains(configKey))
@@ -100,19 +86,6 @@ public boolean apply(
10086
callListenerRemoveTarget(hinter, configKey);
10187
}
10288

103-
// Step 4: For ASM_DD, apply changes AFTER removes
104-
if (product == Product.ASM_DD) {
105-
for (ParsedConfigKey configKey : changedKeys) {
106-
try {
107-
byte[] content = getTargetFileContent(fleetResponse, configKey);
108-
callListenerApplyTarget(fleetResponse, hinter, configKey, content);
109-
} catch (ReportableException e) {
110-
recordError(e);
111-
}
112-
}
113-
}
114-
115-
// Step 5: Commit if there were changes
11689
if (changesDetected) {
11790
try {
11891
callListenerCommit(hinter);

0 commit comments

Comments
 (0)