From dbe35b9be261dc41cdbe79d11dddf64e1b47964e Mon Sep 17 00:00:00 2001 From: James Agnew Date: Thu, 24 Aug 2017 14:35:45 -0400 Subject: [PATCH] More tweaks to concept refreshing --- .../java/ca/uhn/fhir/jpa/term/BaseHapiTerminologySvc.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseHapiTerminologySvc.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseHapiTerminologySvc.java index 52a9c8a81f1..bb3f5f7144f 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseHapiTerminologySvc.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/BaseHapiTerminologySvc.java @@ -360,11 +360,14 @@ public abstract class BaseHapiTerminologySvc implements IHapiTerminologySvc { Collection parentLinks = myConceptParentChildLinkDao.findAllWithChild(theConceptPid); if (parentLinks.isEmpty()) { myChildToParentPidCache.put(theConceptPid, -1L); + ourLog.info("Found {} parent concepts of concept {} (cache has {})", 0, theConceptPid, myChildToParentPidCache.size()); return; } else { for (Long next : parentLinks) { myChildToParentPidCache.put(theConceptPid, next); } + int parentCount = myChildToParentPidCache.get(theConceptPid).size(); + ourLog.info("Found {} parent concepts of concept {} (cache has {})", parentCount, theConceptPid, myChildToParentPidCache.size()); } } @@ -376,9 +379,6 @@ public abstract class BaseHapiTerminologySvc implements IHapiTerminologySvc { createParentsString(theParentsBuilder, nextParent); } - int parentCount = myChildToParentPidCache.get(theConceptPid).size(); - ourLog.info("Found {} parent concepts of concept {} (cache has {})", parentCount, theConceptPid, myChildToParentPidCache.size()); - } @Override @@ -390,8 +390,8 @@ public abstract class BaseHapiTerminologySvc implements IHapiTerminologySvc { ourLog.info("Clearing parent concept cache"); myNextReindexPass = System.currentTimeMillis() + DateUtils.MILLIS_PER_MINUTE; myChildToParentPidCache = null; - return; } + return; } if (myChildToParentPidCache == null) {