changelog
This commit is contained in:
parent
e74dec1fa6
commit
1367e61c93
|
@ -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."
|
|
@ -23,13 +23,10 @@ package ca.uhn.fhir.jpa.util;
|
||||||
import ca.uhn.fhir.jpa.api.config.DaoConfig;
|
import ca.uhn.fhir.jpa.api.config.DaoConfig;
|
||||||
import ca.uhn.fhir.jpa.api.model.TranslationQuery;
|
import ca.uhn.fhir.jpa.api.model.TranslationQuery;
|
||||||
import ca.uhn.fhir.jpa.model.entity.TagTypeEnum;
|
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.Cache;
|
||||||
import com.github.benmanes.caffeine.cache.Caffeine;
|
import com.github.benmanes.caffeine.cache.Caffeine;
|
||||||
import org.apache.commons.lang3.builder.EqualsBuilder;
|
import org.apache.commons.lang3.builder.EqualsBuilder;
|
||||||
import org.apache.commons.lang3.builder.HashCodeBuilder;
|
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.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.transaction.support.TransactionSynchronization;
|
import org.springframework.transaction.support.TransactionSynchronization;
|
||||||
import org.springframework.transaction.support.TransactionSynchronizationManager;
|
import org.springframework.transaction.support.TransactionSynchronizationManager;
|
||||||
|
@ -38,7 +35,6 @@ import javax.annotation.Nonnull;
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
import java.util.EnumMap;
|
import java.util.EnumMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
import static java.util.concurrent.TimeUnit.MINUTES;
|
import static java.util.concurrent.TimeUnit.MINUTES;
|
||||||
|
@ -169,7 +165,7 @@ public class MemoryCacheService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void invalidateAllCaches() {
|
public void invalidateAllCaches() {
|
||||||
myCaches.values().forEach(t -> t.invalidateAll());
|
myCaches.values().forEach(Cache::invalidateAll);
|
||||||
}
|
}
|
||||||
|
|
||||||
private <K, T> Cache<K, T> getCache(CacheEnum theCache) {
|
private <K, T> Cache<K, T> getCache(CacheEnum theCache) {
|
||||||
|
|
|
@ -73,7 +73,6 @@ class MemoryCacheServiceTest {
|
||||||
|
|
||||||
// when we spill the cache, and have delayed calculation.
|
// when we spill the cache, and have delayed calculation.
|
||||||
final boolean[] canProceed = new boolean[]{ false };
|
final boolean[] canProceed = new boolean[]{ false };
|
||||||
List<SlowFastJob> jobs = new ArrayList<>();
|
|
||||||
List<SlowFastJob> slowJobs = new ArrayList<>();
|
List<SlowFastJob> slowJobs = new ArrayList<>();
|
||||||
List<SlowFastJob> fastJobs = new ArrayList<>();
|
List<SlowFastJob> fastJobs = new ArrayList<>();
|
||||||
for (int i = 0; i < 1000; i++) {
|
for (int i = 0; i < 1000; i++) {
|
||||||
|
@ -85,7 +84,6 @@ class MemoryCacheServiceTest {
|
||||||
} else {
|
} else {
|
||||||
fastJobs.add(job);
|
fastJobs.add(job);
|
||||||
}
|
}
|
||||||
jobs.add(job);
|
|
||||||
job.submit(executor);
|
job.submit(executor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,7 +132,9 @@ class MemoryCacheServiceTest {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(100);
|
Thread.sleep(100);
|
||||||
ourLog.debug("yawn " + myValue);
|
ourLog.debug("yawn " + myValue);
|
||||||
} catch (InterruptedException e) { }
|
} catch (InterruptedException e) {
|
||||||
|
// empty
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return myValue;
|
return myValue;
|
||||||
|
|
Loading…
Reference in New Issue