Remove debug from MaxMind util
This commit is contained in:
parent
d2dcd8c3e1
commit
1f3d01b4e2
@ -8,13 +8,11 @@ import io.vertx.core.http.HttpClient;
|
|||||||
import io.vertx.core.http.HttpClientOptions;
|
import io.vertx.core.http.HttpClientOptions;
|
||||||
import io.vertx.core.json.JsonObject;
|
import io.vertx.core.json.JsonObject;
|
||||||
import lombok.experimental.UtilityClass;
|
import lombok.experimental.UtilityClass;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import net.frozenorb.apiv3.APIv3;
|
import net.frozenorb.apiv3.APIv3;
|
||||||
import net.frozenorb.apiv3.maxmind.MaxMindResult;
|
import net.frozenorb.apiv3.maxmind.MaxMindResult;
|
||||||
|
|
||||||
import java.util.Base64;
|
import java.util.Base64;
|
||||||
|
|
||||||
@Slf4j
|
|
||||||
@UtilityClass
|
@UtilityClass
|
||||||
public class MaxMindUtils {
|
public class MaxMindUtils {
|
||||||
|
|
||||||
@ -53,8 +51,6 @@ public class MaxMindUtils {
|
|||||||
});
|
});
|
||||||
|
|
||||||
response.exceptionHandler((error) -> {
|
response.exceptionHandler((error) -> {
|
||||||
log.error("Got failure from MaxMind (" + ip + ")");
|
|
||||||
|
|
||||||
// we have to check !failed because the circuit breaker's timeout will mark us as failed already
|
// we have to check !failed because the circuit breaker's timeout will mark us as failed already
|
||||||
if (!future.failed()) {
|
if (!future.failed()) {
|
||||||
future.fail(error);
|
future.fail(error);
|
||||||
@ -63,10 +59,7 @@ public class MaxMindUtils {
|
|||||||
})
|
})
|
||||||
.putHeader("Authorization", authHeader)
|
.putHeader("Authorization", authHeader)
|
||||||
.end();
|
.end();
|
||||||
}, (ignored) -> {
|
}, (ignored) -> null).setHandler((result) -> { // The (ignored) -> null section is our fallback, which just returns null (when the breaker is open)
|
||||||
log.error("Defaulting to failed MaxMind response (open breaker) (" + ip + ")");
|
|
||||||
return null;
|
|
||||||
}).setHandler((result) -> { // The (ignored) -> null section is our fallback, which just returns null (when the breaker is open)
|
|
||||||
if (result.failed()) {
|
if (result.failed()) {
|
||||||
callback.onResult(null, result.cause());
|
callback.onResult(null, result.cause());
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user