Skip to content

Commit 37a7f98

Browse files
committed
moved block
1 parent 9117c38 commit 37a7f98

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,19 @@ public SplitChange fetch(long since, long sinceRBS, FetchOptions options) {
100100
String.format("Could not retrieve splitChanges since %s; http return code %s", since, response.statusCode())
101101
);
102102
}
103+
104+
String body = response.body();
105+
if (specVersion.equals(Spec.SPEC_1_1)) {
106+
return Json.fromJson(body, SplitChangesOldPayloadDto.class).toSplitChange();
107+
}
108+
109+
return Json.fromJson(body, SplitChange.class);
110+
103111
} catch (Exception e) {
104112
throw new IllegalStateException(String.format("Problem fetching splitChanges since %s: %s", since, e), e);
105113
} finally {
106114
_telemetryRuntimeProducer.recordSyncLatency(HTTPLatenciesEnum.SPLITS, System.currentTimeMillis() - start);
107115
}
108-
109-
String body = response.body();
110-
if (specVersion.equals(Spec.SPEC_1_1)) {
111-
return Json.fromJson(body, SplitChangesOldPayloadDto.class).toSplitChange();
112-
}
113-
114-
return Json.fromJson(body, SplitChange.class);
115116
}
116117

117118
public Long getLastProxyCheckTimestamp() {

0 commit comments

Comments
 (0)