Skip to content

Commit 64e4001

Browse files
committed
Merge branch 'refs/heads/fix-caching-getOrComputeAllDestinations' into add-preLookup-Check
2 parents f22e9be + bf81047 commit 64e4001

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

  • cloudplatform/connectivity-destination-service/src/main/java/com/sap/cloud/sdk/cloudplatform/connectivity

cloudplatform/connectivity-destination-service/src/main/java/com/sap/cloud/sdk/cloudplatform/connectivity/DestinationService.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import java.time.Duration;
44
import java.util.ArrayList;
5+
import java.util.Arrays;
56
import java.util.Collection;
67
import java.util.LinkedHashMap;
78
import java.util.List;
@@ -907,11 +908,23 @@ private static Try<List<DestinationProperties>> getOrComputeAllDestinations(
907908
return destinationDownloader.apply(options);
908909
}
909910

911+
if( isUsingExperimentalFeatures(options) ) {
912+
log
913+
.warn(
914+
"Using cache/change detection together with either fragments, cross-level options, or custom headers is discouraged and might lead to unexpected behaviour.");
915+
}
916+
910917
return GetOrComputeAllDestinationsCommand
911918
.prepareCommand(options, instanceAll(), isolationLocks(), destinationDownloader)
912919
.execute();
913920
}
914921

922+
private static boolean isUsingExperimentalFeatures( @Nonnull final DestinationOptions options )
923+
{
924+
String[] featureNames = { "X-fragment-name", "crossLevelSetting", "customHeader" };
925+
return options.getOptionKeys().stream().anyMatch(s -> Arrays.stream(featureNames).anyMatch(s::contains));
926+
}
927+
915928
private Cache()
916929
{
917930
throw new IllegalStateException("This static class must never be instantiated.");

0 commit comments

Comments
 (0)