Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public final class HttpSplitChangeFetcher implements SplitChangeFetcher {
private static final String SETS = "sets";
private static final String SPEC = "s";
private String specVersion = SPEC_1_3;
private int PROXY_CHECK_INTERVAL_MILLISECONDS_SS = 24 * 60 * 60 * 1000;
private int PROXY_CHECK_INTERVAL_MILLISECONDS_SS = 24 * 60 * 60 * 1000;
private Long _lastProxyCheckTimestamp = 0L;
private final SplitHttpClient _client;
private final URI _target;
Expand Down Expand Up @@ -70,11 +70,13 @@ long makeRandomTill() {
public SplitChange fetch(long since, long sinceRBS, FetchOptions options) {
long start = System.currentTimeMillis();
try {
URI uri = buildURL(options, since, sinceRBS);
if (specVersion.equals(SPEC_1_1) && (System.currentTimeMillis() - _lastProxyCheckTimestamp >= PROXY_CHECK_INTERVAL_MILLISECONDS_SS)) {
_log.info("Switching to new Feature flag spec ({}) and fetching.", SPEC_1_3);
specVersion = SPEC_1_3;
uri = buildURL(options, -1,-1);
}
URI uri = buildURL(options, since, sinceRBS);

SplitHttpResponse response = _client.get(uri, options, null);
if (response.statusCode() < HttpStatus.SC_OK || response.statusCode() >= HttpStatus.SC_MULTIPLE_CHOICES) {
if (response.statusCode() == HttpStatus.SC_REQUEST_URI_TOO_LONG) {
Expand Down