diff --git a/src/main/java/redis/clients/jedis/ConnectionPoolConfig.java b/src/main/java/redis/clients/jedis/ConnectionPoolConfig.java index 48ea4942e0..4525678511 100644 --- a/src/main/java/redis/clients/jedis/ConnectionPoolConfig.java +++ b/src/main/java/redis/clients/jedis/ConnectionPoolConfig.java @@ -1,5 +1,6 @@ package redis.clients.jedis; +import java.time.Duration; import org.apache.commons.pool2.impl.GenericObjectPoolConfig; public class ConnectionPoolConfig extends GenericObjectPoolConfig { @@ -7,8 +8,8 @@ public class ConnectionPoolConfig extends GenericObjectPoolConfig { public ConnectionPoolConfig() { // defaults to make your life with connection pool easier :) setTestWhileIdle(true); - setMinEvictableIdleTimeMillis(60000); - setTimeBetweenEvictionRunsMillis(30000); + setMinEvictableIdleTime(Duration.ofMillis(60000)); + setTimeBetweenEvictionRuns(Duration.ofMillis(30000)); setNumTestsPerEvictionRun(-1); } } diff --git a/src/main/java/redis/clients/jedis/JedisPoolConfig.java b/src/main/java/redis/clients/jedis/JedisPoolConfig.java index c88364bf4f..476d2e3f09 100644 --- a/src/main/java/redis/clients/jedis/JedisPoolConfig.java +++ b/src/main/java/redis/clients/jedis/JedisPoolConfig.java @@ -1,5 +1,6 @@ package redis.clients.jedis; +import java.time.Duration; import org.apache.commons.pool2.impl.GenericObjectPoolConfig; public class JedisPoolConfig extends GenericObjectPoolConfig { @@ -7,8 +8,8 @@ public class JedisPoolConfig extends GenericObjectPoolConfig { public JedisPoolConfig() { // defaults to make your life with connection pool easier :) setTestWhileIdle(true); - setMinEvictableIdleTimeMillis(60000); - setTimeBetweenEvictionRunsMillis(30000); + setMinEvictableIdleTime(Duration.ofMillis(60000)); + setTimeBetweenEvictionRuns(Duration.ofMillis(30000)); setNumTestsPerEvictionRun(-1); } }