Add short circuit to MaxMindUtils until we can fix (with timeout + circuit breaker)
This commit is contained in:
parent
a6e31129e9
commit
9043abfa72
|
@ -21,6 +21,11 @@ public class MaxMindUtils {
|
|||
private static final HttpClient httpsClient = APIv3.getVertxInstance().createHttpClient(new HttpClientOptions().setSsl(true).setTrustAll(true));
|
||||
|
||||
public static void getInsights(String ip, SingleResultCallback<MaxMindResult> callback) {
|
||||
if (1 == 1) {
|
||||
callback.onResult(null, null);
|
||||
return;
|
||||
}
|
||||
|
||||
String authHeader = "Basic " + Base64.getEncoder().encodeToString((maxMindUserId + ":" + maxMindLicenseKey).getBytes(Charsets.UTF_8));
|
||||
|
||||
httpsClient.get(443, "geoip.maxmind.com", "/geoip/v2.1/insights/" + ip, (response) -> {
|
||||
|
@ -38,6 +43,7 @@ public class MaxMindUtils {
|
|||
response.exceptionHandler((error) -> callback.onResult(null, error));
|
||||
})
|
||||
.putHeader("Authorization", authHeader)
|
||||
.setTimeout(1000)
|
||||
.end();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue