From 830263d279c1a34052c5291717adf7f8e1a75d08 Mon Sep 17 00:00:00 2001 From: Michael Osipov Date: Sun, 15 Dec 2019 10:57:30 +0100 Subject: [PATCH] Use TimeValue#sleep() --- .../org/apache/hc/client5/http/impl/IdleConnectionEvictor.java | 2 +- .../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 79d9068c2..1e7258e65 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 13ddb63e6..0594ec7af 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) {