Skip to content

Commit

Permalink
moved new http client out the method
Browse files Browse the repository at this point in the history
  • Loading branch information
J3fftw1 committed Jul 3, 2023
1 parent e2b2585 commit 0a762e8
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public class UUIDLookup {
private static final JsonParser JSON_PARSER = new JsonParser();
private static final String ERROR_TOKEN = "error";
private static final Pattern NAME_PATTERN = Pattern.compile("[\\w]+");

private final HttpClient client = HttpClient.newHttpClient();

private UUIDLookup() {}

/**
Expand All @@ -53,7 +54,6 @@ private UUIDLookup() {}

String targetUrl = "https://playerdb.co/api/player/minecraft/" + name;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(targetUrl))
.timeout(Duration.ofMinutes(2))
Expand Down

0 comments on commit 0a762e8

Please sign in to comment.