We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent aa2994e commit 603b963Copy full SHA for 603b963
src/main/java/org/dataloader/DataLoader.java
@@ -180,10 +180,12 @@ public CompletableFuture<V> load(K key) {
180
Object cacheKey = getCacheKey(nonNull(key));
181
stats.incrementLoadCount();
182
183
- synchronized (futureCache) {
184
- if (loaderOptions.cachingEnabled() && futureCache.containsKey(cacheKey)) {
185
- stats.incrementCacheHitCount();
186
- return futureCache.get(cacheKey);
+ if (loaderOptions.cachingEnabled()) {
+ synchronized (futureCache) {
+ if (futureCache.containsKey(cacheKey)) {
+ stats.incrementCacheHitCount();
187
+ return futureCache.get(cacheKey);
188
+ }
189
}
190
191
0 commit comments