File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
databend-client/src/main/java/com/databend/client
databend-jdbc/src/main/java/com/databend/jdbc Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change 2020public class ClientSettings {
2121 public static final Integer DEFAULT_QUERY_TIMEOUT = 300 ;
2222 // seconds
23- public static final Integer DEFAULT_CONNECTION_TIMEOUT = 0 ;
23+ public static final Integer DEFAULT_CONNECTION_TIMEOUT = 60 ;
2424 public static final Integer DEFAULT_SOCKET_TIMEOUT = 0 ;
2525 public static final int DEFAULT_RETRY_ATTEMPTS = 5 ;
2626 public static final String X_Databend_Query_ID = "X-DATABEND-QUERY-ID" ;
Original file line number Diff line number Diff line change @@ -451,7 +451,9 @@ public void setupClient(OkHttpClient.Builder builder) throws SQLException {
451451 builder .addInterceptor (tokenAuth (ACCESS_TOKEN .getValue (properties ).get ()));
452452 }
453453 if (CONNECTION_TIMEOUT .getValue (properties ).isPresent ()) {
454- builder .connectTimeout (CONNECTION_TIMEOUT .getValue (properties ).get (), TimeUnit .SECONDS );
454+ Integer timeout = CONNECTION_TIMEOUT .getValue (properties ).get ();
455+ if (timeout != 0 )
456+ builder .connectTimeout (timeout , TimeUnit .SECONDS );
455457 }
456458 if (SOCKET_TIMEOUT .getValue (properties ).isPresent ()) {
457459 builder .readTimeout (SOCKET_TIMEOUT .getValue (properties ).get (), TimeUnit .SECONDS );
You can’t perform that action at this time.
0 commit comments