Skip to content

Commit 6af47f4

Browse files
committed
handle 0 timeout
1 parent 32e7a43 commit 6af47f4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jdbc-v2/src/main/java/com/clickhouse/jdbc/ConnectionImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,9 @@ public boolean isValid(int timeout) throws SQLException {
495495
if (isClosed()) {
496496
return false;
497497
}
498-
return client.ping(Duration.ofSeconds(timeout).toMillis());
498+
return timeout == 0
499+
? client.ping()
500+
: client.ping(Duration.ofSeconds(timeout).toMillis());
499501
}
500502

501503
@Override

0 commit comments

Comments
 (0)