From 5f058f8e4243f9cab5b801ddd975cbe440e7f56d Mon Sep 17 00:00:00 2001 From: Roman Khlebnov Date: Thu, 25 Apr 2024 00:28:35 +0300 Subject: [PATCH] Fixing missing invocations inside Try --- README.md | 4 ++-- gradle.properties | 2 +- .../suppie/spring/cache/MultiLevelCache.java | 14 ++++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d80d3f4..c61ede8 100644 --- a/README.md +++ b/README.md @@ -43,13 +43,13 @@ This version does not allow setting most of the local cache properties in favor io.github.suppierk spring-boot-multilevel-cache-starter - 3.2.5.1 + 3.2.5.2 ``` ### Gradle ```groovy -implementation 'io.github.suppierk:spring-boot-multilevel-cache-starter:3.2.5.1' +implementation 'io.github.suppierk:spring-boot-multilevel-cache-starter:3.2.5.2' ``` ## Default configuration diff --git a/gradle.properties b/gradle.properties index 5a43e74..e57979f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -27,7 +27,7 @@ SONATYPE_AUTOMATIC_RELEASE=true GROUP=io.github.suppierk POM_ARTIFACT_ID=spring-boot-multilevel-cache-starter -VERSION_NAME=3.2.5.1 +VERSION_NAME=3.2.5.2 POM_PACKAGING=jar POM_NAME=Spring Boot Multilevel Cache Starter diff --git a/src/main/java/io/github/suppie/spring/cache/MultiLevelCache.java b/src/main/java/io/github/suppie/spring/cache/MultiLevelCache.java index bdada23..b714005 100644 --- a/src/main/java/io/github/suppie/spring/cache/MultiLevelCache.java +++ b/src/main/java/io/github/suppie/spring/cache/MultiLevelCache.java @@ -146,7 +146,7 @@ T nativeGet(@NonNull Object key) { } void nativePut(@NonNull Object key, @Nullable Object value) { - super.put(key, value); + callRedis(() -> super.put(key, value)); } // Workarounds for tests @@ -427,7 +427,7 @@ public boolean invalidate() { private void callRedis(@NonNull Runnable call) { Try.of( () -> { - cacheCircuitBreaker.decorateRunnable(call); + cacheCircuitBreaker.decorateRunnable(call).run(); return null; }); } @@ -446,10 +446,12 @@ private Try callRedis(@NonNull CheckedSupplier call) { private void sendViaRedis(@Nullable String key) { Try.of( () -> { - cacheCircuitBreaker.decorateRunnable( - () -> - redisTemplate.convertAndSend( - properties.getTopic(), new MultiLevelCacheEvictMessage(getName(), key))); + cacheCircuitBreaker + .decorateRunnable( + () -> + redisTemplate.convertAndSend( + properties.getTopic(), new MultiLevelCacheEvictMessage(getName(), key))) + .run(); return null; }); }