sanghwa-min commented on code in PR #714:
URL: 
https://github.com/apache/httpcomponents-client/pull/714#discussion_r2306157811


##########
httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncClientBuilder.java:
##########
@@ -1094,8 +1095,10 @@ public CloseableHttpAsyncClient build() {
             }
             if (evictExpiredConnections || evictIdleConnections) {
                 if (connManagerCopy instanceof ConnPoolControl) {
+                    TimeValue sleepTime = maxIdleTime.divide(10, 
TimeUnit.NANOSECONDS);
+                    sleepTime = sleepTime.compareTo(TimeValue.ofSeconds(1L)) < 
0 ? TimeValue.ofSeconds(1L) : sleepTime;

Review Comment:
   @ok2c 
   Yes, that's a good point. Adding a constant would improve readability.
   
   I actually considered this in a previous commit, along with a new 
`TimeValue.max(TimeValue other)` method. However, I implemented the logic in 
the `Builder` instead, after realizing that `TimeValue` belongs to the separate 
`httpcomponent-core` project.
   
   To clarify, are you suggesting that the `ONE_SECOND` constant should be a 
`public static final` field within each `Builder` class?
   
   If you think modifying the `TimeValue` class is the more appropriate 
approach, I will open a new PR for the `httpcomponent-core` project.
   
   Thank you for your feedback.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to