Skip to content

Commit 1c8cc73

Browse files
Polishing.
Delegate value loading to existing method to remove duplicate code paths. Original Pull Request: #2785
1 parent a2af06d commit 1c8cc73

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/main/java/org/springframework/data/redis/cache/RedisCache.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,7 @@ public CompletableFuture<ValueWrapper> retrieve(Object key) {
293293
@SuppressWarnings("unchecked")
294294
public <T> CompletableFuture<T> retrieve(Object key, Supplier<CompletableFuture<T>> valueLoader) {
295295

296-
if (!getCacheWriter().supportsAsyncRetrieve()) {
297-
throw new UnsupportedOperationException(CACHE_RETRIEVAL_UNSUPPORTED_OPERATION_EXCEPTION_MESSAGE);
298-
}
299-
300-
return retrieveValue(key).thenCompose(wrapper -> {
296+
return retrieve(key).thenCompose(wrapper -> {
301297

302298
if (wrapper != null) {
303299
return CompletableFuture.completedFuture((T) wrapper.get());

0 commit comments

Comments
 (0)