Skip to content

Commit

Permalink
use the default HttpClient executor in DependencyDownloader
Browse files Browse the repository at this point in the history
(HttpClient *really* doesn't want to be used synchronously)

by reusing the HttpClient we still avoid redundant threads, we just can't reuse the thread making the request for handling it
  • Loading branch information
jpenilla committed Jul 6, 2023
1 parent f7e59a2 commit 25b88f3
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ public DependencyDownloader(
) {
this.logger = logger;
this.cacheDir = cacheDir;
this.client = HttpClient.newBuilder()
// using a cached thread pool (default) is completely redundant with how we use the client
.executor(Runnable::run)
.build();
this.client = HttpClient.newHttpClient();
}

public Set<Path> resolve() {
Expand Down

0 comments on commit 25b88f3

Please sign in to comment.