diff --git a/jetcache-support/jetcache-redis-lettuce/src/main/java/com/alicp/jetcache/redis/lettuce/LettuceConnectionManager.java b/jetcache-support/jetcache-redis-lettuce/src/main/java/com/alicp/jetcache/redis/lettuce/LettuceConnectionManager.java index 6a18357b9..2c038268a 100644 --- a/jetcache-support/jetcache-redis-lettuce/src/main/java/com/alicp/jetcache/redis/lettuce/LettuceConnectionManager.java +++ b/jetcache-support/jetcache-redis-lettuce/src/main/java/com/alicp/jetcache/redis/lettuce/LettuceConnectionManager.java @@ -121,5 +121,6 @@ public void removeAndClose(AbstractRedisClient redisClient) { if (lo.connection != null) { lo.connection.close(); } + redisClient.shutdown(); } } diff --git a/jetcache-support/jetcache-redis-lettuce4/src/main/java/com/alicp/jetcache/redis/lettuce4/LettuceConnectionManager.java b/jetcache-support/jetcache-redis-lettuce4/src/main/java/com/alicp/jetcache/redis/lettuce4/LettuceConnectionManager.java index ccaf7823d..9c6cb3f9c 100644 --- a/jetcache-support/jetcache-redis-lettuce4/src/main/java/com/alicp/jetcache/redis/lettuce4/LettuceConnectionManager.java +++ b/jetcache-support/jetcache-redis-lettuce4/src/main/java/com/alicp/jetcache/redis/lettuce4/LettuceConnectionManager.java @@ -121,5 +121,6 @@ public void removeAndClose(AbstractRedisClient redisClient) { if (lo.connection != null) { lo.connection.close(); } + redisClient.shutdown(); } } diff --git a/jetcache-test/src/test/java/com/alicp/jetcache/redis/lettuce/RedisLettuceCacheTest.java b/jetcache-test/src/test/java/com/alicp/jetcache/redis/lettuce/RedisLettuceCacheTest.java index 248adfbfe..3a8d730b0 100644 --- a/jetcache-test/src/test/java/com/alicp/jetcache/redis/lettuce/RedisLettuceCacheTest.java +++ b/jetcache-test/src/test/java/com/alicp/jetcache/redis/lettuce/RedisLettuceCacheTest.java @@ -94,6 +94,8 @@ public void testWithMultiLevelCache() throws Exception { LoadingCacheTest.loadingCacheTest(MultiLevelCacheBuilder.createMultiLevelCacheBuilder() .expireAfterWrite(5000, TimeUnit.MILLISECONDS) .addCache(l1Cache, l2Cache), 50); + + LettuceConnectionManager.defaultManager().removeAndClose(client); } private void test(AbstractRedisClient client) throws Exception { diff --git a/jetcache-test/src/test/java/com/alicp/jetcache/redis/lettuce4/RedisLettuceCacheTest.java b/jetcache-test/src/test/java/com/alicp/jetcache/redis/lettuce4/RedisLettuceCacheTest.java index 6aef4ff50..a4710956e 100644 --- a/jetcache-test/src/test/java/com/alicp/jetcache/redis/lettuce4/RedisLettuceCacheTest.java +++ b/jetcache-test/src/test/java/com/alicp/jetcache/redis/lettuce4/RedisLettuceCacheTest.java @@ -94,6 +94,8 @@ public void testWithMultiLevelCache() throws Exception { LoadingCacheTest.loadingCacheTest(MultiLevelCacheBuilder.createMultiLevelCacheBuilder() .expireAfterWrite(5000, TimeUnit.MILLISECONDS) .addCache(l1Cache, l2Cache), 50); + + LettuceConnectionManager.defaultManager().removeAndClose(client); } private void test(AbstractRedisClient client) throws Exception {