@@ -16,11 +16,9 @@ import io.grpc.CallCredentials
16
16
import io .grpc .netty .shaded .io .grpc .netty .NettyChannelBuilder
17
17
import io .grpc .netty .shaded .io .netty .handler .ssl .SslProvider
18
18
19
- import java .util .Optional
20
19
import javax .net .ssl .{ SSLContext , TrustManager }
21
20
import scala .collection .immutable
22
21
import scala .concurrent .duration .{ Duration , _ }
23
- import scala .jdk .OptionConverters .RichOptional
24
22
25
23
object GrpcClientSettings {
26
24
@@ -167,7 +165,7 @@ object GrpcClientSettings {
167
165
}
168
166
169
167
private def getOptionalDuration (config : Config , path : String ): Option [FiniteDuration ] =
170
- config.getString(path) match {
168
+ Helpers .toRootLowerCase( config.getString(path) ) match {
171
169
case " off" => None
172
170
case _ => Some (config.getDuration(path).asScala)
173
171
}
@@ -297,25 +295,25 @@ final class GrpcClientSettings private (
297
295
298
296
/**
299
297
* Scala API: Set this to a duration to trigger periodic refresh of the resolved endpoints, evicting cached entries
300
- * if the discovery mechanism supports that. The default value `None` disables periodic refresh and instead
301
- * only does refresh when the client implementation decides to.
298
+ * if the discovery mechanism supports that. The default is no periodic refresh and instead
299
+ * * only does refresh when the client implementation decides to.
302
300
*
303
301
* Currently only supported by the Netty client backend.
304
302
*/
305
303
@ ApiMayChange
306
- def withDiscoveryRefreshInterval (refreshInterval : Option [ FiniteDuration ] ): GrpcClientSettings =
307
- copy(discoveryRefreshInterval = refreshInterval)
304
+ def withDiscoveryRefreshInterval (refreshInterval : FiniteDuration ): GrpcClientSettings =
305
+ copy(discoveryRefreshInterval = Some ( refreshInterval) )
308
306
309
307
/**
310
308
* Java API: Set this to a duration to trigger periodic refresh of the resolved endpoints, evicting cached entries
311
- * if the discovery mechanism supports that. The default value `None` disables periodic refresh and instead
309
+ * if the discovery mechanism supports that. The default is no periodic refresh and instead
312
310
* only does refresh when the client implementation decides to.
313
311
*
314
312
* Currently only supported by the Netty client backend.
315
313
*/
316
314
@ ApiMayChange
317
- def withDiscoveryRefreshInterval (refreshInterval : Optional [ java.time.Duration ] ): GrpcClientSettings =
318
- copy(discoveryRefreshInterval = refreshInterval.map(_. asScala).toScala )
315
+ def withDiscoveryRefreshInterval (refreshInterval : java.time.Duration ): GrpcClientSettings =
316
+ copy(discoveryRefreshInterval = Some ( refreshInterval.asScala))
319
317
320
318
private def copy (
321
319
serviceName : String = serviceName,
0 commit comments