Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing missing invocations inside Try #25

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ This version does not allow setting most of the local cache properties in favor
<dependency>
<groupId>io.github.suppierk</groupId>
<artifactId>spring-boot-multilevel-cache-starter</artifactId>
<version>3.2.5.1</version>
<version>3.2.5.2</version>
</dependency>
```

### 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
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 8 additions & 6 deletions src/main/java/io/github/suppie/spring/cache/MultiLevelCache.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ <T> 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
Expand Down Expand Up @@ -427,7 +427,7 @@ public boolean invalidate() {
private void callRedis(@NonNull Runnable call) {
Try.of(
() -> {
cacheCircuitBreaker.decorateRunnable(call);
cacheCircuitBreaker.decorateRunnable(call).run();
return null;
});
}
Expand All @@ -446,10 +446,12 @@ private <T> Try<T> callRedis(@NonNull CheckedSupplier<T> 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;
});
}
Expand Down
Loading