From 3713828caf4874e6f1102ddf6e1360f31433070b Mon Sep 17 00:00:00 2001 From: Yong Sheng Tan Date: Mon, 25 Nov 2024 17:28:22 +0800 Subject: [PATCH] Add callTimeout field to ConductorClient builder --- .../netflix/conductor/client/http/ConductorClient.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/conductor-clients/java/conductor-java-sdk/conductor-client/src/main/java/com/netflix/conductor/client/http/ConductorClient.java b/conductor-clients/java/conductor-java-sdk/conductor-client/src/main/java/com/netflix/conductor/client/http/ConductorClient.java index 9cf7a7d21..127a55ae2 100644 --- a/conductor-clients/java/conductor-java-sdk/conductor-client/src/main/java/com/netflix/conductor/client/http/ConductorClient.java +++ b/conductor-clients/java/conductor-java-sdk/conductor-client/src/main/java/com/netflix/conductor/client/http/ConductorClient.java @@ -101,6 +101,10 @@ protected ConductorClient(Builder builder) { okHttpBuilder.writeTimeout(builder.writeTimeout, TimeUnit.MILLISECONDS); } + if (builder.callTimeout > -1) { + okHttpBuilder.callTimeout(builder.callTimeout, TimeUnit.MILLISECONDS); + } + if (builder.proxy != null) { okHttpBuilder.proxy(builder.proxy); } @@ -442,6 +446,7 @@ public static class Builder> { private long connectTimeout = -1; private long readTimeout = -1; private long writeTimeout = -1; + private long callTimeout = -1; private Proxy proxy; private ConnectionPoolConfig connectionPoolConfig; private Supplier objectMapperSupplier = () -> new ObjectMapperProvider().getObjectMapper(); @@ -487,6 +492,11 @@ public T writeTimeout(long writeTimeout) { return self(); } + public T callTimeout(long callTimeout) { + this.callTimeout = callTimeout; + return self(); + } + public T proxy(Proxy proxy) { this.proxy = proxy; return self();