markusthoemmes commented on a change in pull request #4316: Update version for 
Akka dependencies and Scala
URL: 
https://github.com/apache/incubator-openwhisk/pull/4316#discussion_r282002808
 
 

 ##########
 File path: 
common/scala/src/main/scala/org/apache/openwhisk/http/PoolingRestClient.scala
 ##########
 @@ -53,8 +53,13 @@ class PoolingRestClient(
 
   //if specified, override the ClientConnection idle-timeout and keepalive 
socket option value
   private val timeoutSettings = {
-    
ConnectionPoolSettings(system.settings.config).withUpdatedConnectionSettings { 
s =>
-      timeout.map(t => s.withIdleTimeout(t)).getOrElse(s)
+    val cps = ConnectionPoolSettings(system.settings.config)
+    timeout match {
+      case Some(t) =>
+        cps
+          .withMaxConnectionBackoff(cps.maxConnectionBackoff.min(t))
+          .withUpdatedConnectionSettings(_.withIdleTimeout(t))
+      case None => cps
 
 Review comment:
   I'd keep the map/getOrElse here
   
   ```scala
   timeout.map{ t =>
     cps
       .withMaxConnectionBackoff(cps.maxConnectionBackoff.min(t))
       .withUpdatedConnectionSettings(_.withIdleTimeout(t))
   }.getOrElse(cps)
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to