Skip to content

Commit 0af690d

Browse files
committed
polish
1 parent efa44fa commit 0af690d

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

client/src/main/java/io/split/client/HttpSplitChangeFetcher.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,10 @@ public SplitChange fetch(long since, long sinceRBS, FetchOptions options) {
100100
if (specVersion.equals(Spec.SPEC_1_1)) {
101101
return Json.fromJson(response.body(), SplitChangesOldPayloadDto.class).toSplitChange();
102102
}
103-
if (_lastProxyCheckTimestamp != 0) {
104-
splitChange.clearCache = true;
105-
_lastProxyCheckTimestamp = 0L;
106-
}
107-
splitChange = Json.fromJson(response.body(), SplitChange.class);
108-
}
103+
104+
SplitChange splitChange = Json.fromJson(response.body(), SplitChange.class);
105+
splitChange.clearCache = _lastProxyCheckTimestamp != 0;
106+
_lastProxyCheckTimestamp = 0L;
109107
return splitChange;
110108
} catch (Exception e) {
111109
throw new IllegalStateException(String.format("Problem fetching splitChanges since %s: %s", since, e), e);

client/src/main/java/io/split/client/dtos/ChangeDto.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,4 @@ public class ChangeDto<T> {
77
public long s;
88
public long t;
99
public List<T> d;
10-
11-
public static ChangeDto createEmptyDto() {
12-
ChangeDto dto = new ChangeDto<>();
13-
dto.d = new ArrayList<>();
14-
dto.t = -1;
15-
dto.s = -1;
16-
return dto;
17-
}
1810
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ private Set<String> runWithoutExceptionHandling(FetchOptions options) throws Int
147147

148148
synchronized (_lock) {
149149
// check state one more time.
150-
if (checkExitConditions(change.featureFlags, _splitCacheProducer.getChangeNumber()) &&
150+
if (checkExitConditions(change.featureFlags, _splitCacheProducer.getChangeNumber()) ||
151151
checkExitConditions(change.ruleBasedSegments, _ruleBasedSegmentCacheProducer.getChangeNumber())) {
152152
// some other thread may have updated the shared state. exit
153153
return segments;

0 commit comments

Comments
 (0)