Skip to content

Commit 2d22426

Browse files
chillaqsanzmauro
andauthored
Update client/src/main/java/io/split/engine/experiments/SplitFetcherImp.java
Co-authored-by: Mauro Sanz <[email protected]>
1 parent 75ef28f commit 2d22426

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

client/src/main/java/io/split/engine/experiments/SplitFetcherImp.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,17 @@ public FetchResult forceRefresh(FetchOptions options) {
7777
// If the previous execution was the first one, clear the `cdnBypass` flag
7878
// for the next fetches. (This will clear a local copy of the fetch options,
7979
// not the original object that was passed to this method).
80-
if (INITIAL_CN == start || RBS_INITIAL_CN == startRBS) {
81-
if (INITIAL_CN == start) targetChaneNumber = FetchOptions.DEFAULT_TARGET_CHANGENUMBER;
82-
if (RBS_INITIAL_CN == startRBS) targetChaneNumberRBS = FetchOptions.DEFAULT_TARGET_CHANGENUMBER;
83-
options = new FetchOptions.Builder(options).targetChangeNumber(targetChaneNumber).
84-
targetChangeNumberRBS(targetChaneNumberRBS).build();
80+
FetchOptions.Builder optionsBuilder = new FetchOptions.Builder(options);
81+
if (INITIAL_CN == start) {
82+
optionsBuilder.targetChangeNumber(FetchOptions.DEFAULT_TARGET_CHANGENUMBER);
8583
}
8684

85+
if (RBS_INITIAL_CN == startRBS) {
86+
optionsBuilder.targetChangeNumberRBS(FetchOptions.DEFAULT_TARGET_CHANGENUMBER);
87+
}
88+
89+
options = optionsBuilder.build();
90+
8791
if (start >= end && startRBS >= endRBS) {
8892
return new FetchResult(true, false, segments);
8993
}

0 commit comments

Comments
 (0)