Skip to content

Commit

Permalink
fixes #2124 use the client.timeout for the config server timeout (#2125)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevehu authored Feb 13, 2024
1 parent 8cc8f6f commit d404e7d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import ch.qos.logback.core.joran.spi.JoranException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.networknt.client.ClientConfig;
import com.networknt.config.Config;
import com.networknt.config.ConfigInjection;
import com.networknt.config.JsonMapper;
Expand Down Expand Up @@ -100,7 +101,7 @@ private HttpClient createHttpClient() {
}
HttpClient.Builder clientBuilder = HttpClient.newBuilder()
.followRedirects(HttpClient.Redirect.NORMAL)
.connectTimeout(Duration.ofMillis(1000)) // default to 1 second timeout.
.connectTimeout(Duration.ofMillis(ClientConfig.get().getTimeout())) // client.timeout from the client.yml
.version(HttpClient.Version.HTTP_2)
.sslContext(createBootstrapContext());
return clientBuilder.build();
Expand Down

0 comments on commit d404e7d

Please sign in to comment.