Skip to content

Commit 9043dd5

Browse files
committed
Review feedback
1 parent f0784af commit 9043dd5

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

runtime/src/main/scala/akka/grpc/GrpcClientSettings.scala

+8-10
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ import io.grpc.CallCredentials
1616
import io.grpc.netty.shaded.io.grpc.netty.NettyChannelBuilder
1717
import io.grpc.netty.shaded.io.netty.handler.ssl.SslProvider
1818

19-
import java.util.Optional
2019
import javax.net.ssl.{ SSLContext, TrustManager }
2120
import scala.collection.immutable
2221
import scala.concurrent.duration.{ Duration, _ }
23-
import scala.jdk.OptionConverters.RichOptional
2422

2523
object GrpcClientSettings {
2624

@@ -167,7 +165,7 @@ object GrpcClientSettings {
167165
}
168166

169167
private def getOptionalDuration(config: Config, path: String): Option[FiniteDuration] =
170-
config.getString(path) match {
168+
Helpers.toRootLowerCase(config.getString(path)) match {
171169
case "off" => None
172170
case _ => Some(config.getDuration(path).asScala)
173171
}
@@ -297,25 +295,25 @@ final class GrpcClientSettings private (
297295

298296
/**
299297
* 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.
302300
*
303301
* Currently only supported by the Netty client backend.
304302
*/
305303
@ApiMayChange
306-
def withDiscoveryRefreshInterval(refreshInterval: Option[FiniteDuration]): GrpcClientSettings =
307-
copy(discoveryRefreshInterval = refreshInterval)
304+
def withDiscoveryRefreshInterval(refreshInterval: FiniteDuration): GrpcClientSettings =
305+
copy(discoveryRefreshInterval = Some(refreshInterval))
308306

309307
/**
310308
* 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
312310
* only does refresh when the client implementation decides to.
313311
*
314312
* Currently only supported by the Netty client backend.
315313
*/
316314
@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))
319317

320318
private def copy(
321319
serviceName: String = serviceName,

0 commit comments

Comments
 (0)