Skip to content

Commit ae4e480

Browse files
committed
optimise penetration protect
1 parent 8fb54c5 commit ae4e480

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jetcache-core/src/main/java/com/alicp/jetcache/AbstractCache.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ static <K, V> V computeIfAbsentImpl(K key, Function<K, V> loader, boolean cacheN
164164
Consumer<V> cacheUpdater = (loadedValue) -> {
165165
if(needUpdate(loadedValue, cacheNullWhenLoaderReturnNull, newLoader)) {
166166
if (timeUnit != null) {
167-
cache.PUT(key, loadedValue, expireAfterWrite, timeUnit);
167+
cache.PUT(key, loadedValue, expireAfterWrite, timeUnit).waitForResult();
168168
} else {
169-
cache.put(key, loadedValue);
169+
cache.PUT(key, loadedValue).waitForResult();
170170
}
171171
}
172172
};

0 commit comments

Comments
 (0)