changelog

This commit is contained in:
Michael Buckley 2021-06-24 19:13:54 -04:00
parent e74dec1fa6
commit 1367e61c93
3 changed files with 9 additions and 8 deletions

View File

@ -0,0 +1,5 @@
---
type: fix
issue: 2758
title: "The internal cache for tags, concepts, and others had longer or shorter expiry times that was intended.
This has been corrected."

View File

@ -23,13 +23,10 @@ package ca.uhn.fhir.jpa.util;
import ca.uhn.fhir.jpa.api.config.DaoConfig;
import ca.uhn.fhir.jpa.api.model.TranslationQuery;
import ca.uhn.fhir.jpa.model.entity.TagTypeEnum;
import ca.uhn.fhir.rest.api.server.storage.ResourcePersistentId;
import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.hl7.fhir.instance.model.api.IIdType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.support.TransactionSynchronization;
import org.springframework.transaction.support.TransactionSynchronizationManager;
@ -38,7 +35,6 @@ import javax.annotation.Nonnull;
import javax.annotation.PostConstruct;
import java.util.EnumMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import static java.util.concurrent.TimeUnit.MINUTES;
@ -169,7 +165,7 @@ public class MemoryCacheService {
}
public void invalidateAllCaches() {
myCaches.values().forEach(t -> t.invalidateAll());
myCaches.values().forEach(Cache::invalidateAll);
}
private <K, T> Cache<K, T> getCache(CacheEnum theCache) {

View File

@ -73,7 +73,6 @@ class MemoryCacheServiceTest {
// when we spill the cache, and have delayed calculation.
final boolean[] canProceed = new boolean[]{ false };
List<SlowFastJob> jobs = new ArrayList<>();
List<SlowFastJob> slowJobs = new ArrayList<>();
List<SlowFastJob> fastJobs = new ArrayList<>();
for (int i = 0; i < 1000; i++) {
@ -85,7 +84,6 @@ class MemoryCacheServiceTest {
} else {
fastJobs.add(job);
}
jobs.add(job);
job.submit(executor);
}
@ -134,7 +132,9 @@ class MemoryCacheServiceTest {
try {
Thread.sleep(100);
ourLog.debug("yawn " + myValue);
} catch (InterruptedException e) { }
} catch (InterruptedException e) {
// empty
}
}
}
return myValue;