Hi there,
I noticed a discrepancy between the comments and error messages in the QueryOptions.ReadTimeout method and the actual behavior of the code.
I suggest allowing the code to accept 0 without raising an exception to handle disabling the timeout.
|
/** |
|
* Sets the request timeout. Overrides the default timeout. |
|
* |
|
* @param timeout the read timeout. Negative values are not allowed. If it is {@code 0}, the read timeout will be |
|
* disabled for this statement. |
|
* @return {@code this} {@link QueryOptionsBuilder} |
|
* @see com.datastax.oss.driver.api.core.cql.SimpleStatement#setTimeout(Duration) |
|
* @since 3.0 |
|
*/ |
|
public QueryOptionsBuilder timeout(Duration timeout) { |
|
|
|
Assert.isTrue(!timeout.isZero() && !timeout.isNegative(), "ReadTimeout must be greater than equal to zero"); |
|
|
|
this.timeout = timeout; |
|
|
|
return this; |
|
} |
I've also submitted a PR to address this. I would appreciate it if you could review it.
Thank you.
Hi there,
I noticed a discrepancy between the comments and error messages in the QueryOptions.ReadTimeout method and the actual behavior of the code.
I suggest allowing the code to accept 0 without raising an exception to handle disabling the timeout.
spring-data-cassandra/spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/cql/QueryOptions.java
Lines 540 to 556 in 100b267
I've also submitted a PR to address this. I would appreciate it if you could review it.
Thank you.