You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by mi...@apache.org on 2019/12/15 10:49:55 UTC

[httpcomponents-client] 04/12: Use TimeValue#sleep()

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch consistency
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git

commit 830263d279c1a34052c5291717adf7f8e1a75d08
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Sun Dec 15 10:57:30 2019 +0100

    Use TimeValue#sleep()
---
 .../java/org/apache/hc/client5/http/impl/IdleConnectionEvictor.java     | 2 +-
 .../org/apache/hc/client5/http/impl/async/H2AsyncClientBuilder.java     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/IdleConnectionEvictor.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/IdleConnectionEvictor.java
index 79d9068..1e7258e 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/IdleConnectionEvictor.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/IdleConnectionEvictor.java
@@ -59,7 +59,7 @@ public final class IdleConnectionEvictor {
             public void run() {
                 try {
                     while (!Thread.currentThread().isInterrupted()) {
-                        Thread.sleep(localSleepTime.toMillis());
+                        localSleepTime.sleep();
                         connectionManager.closeExpired();
                         if (maxIdleTime != null) {
                             connectionManager.closeIdle(maxIdleTime);
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/H2AsyncClientBuilder.java b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/H2AsyncClientBuilder.java
index 13ddb63..0594ec7 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/H2AsyncClientBuilder.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/H2AsyncClientBuilder.java
@@ -863,7 +863,7 @@ public class H2AsyncClientBuilder {
                 public void run() {
                     try {
                         while (!Thread.currentThread().isInterrupted()) {
-                            Thread.sleep(maxIdleTime.toMillis());
+                            maxIdleTime.sleep();
                             connPool.closeIdle(maxIdleTime);
                         }
                     } catch (final InterruptedException ex) {