More tweaks to concept refreshing

This commit is contained in:
James Agnew 2017-08-24 14:35:45 -04:00
parent 64e03997aa
commit dbe35b9be2
1 changed files with 4 additions and 4 deletions

View File

@ -360,11 +360,14 @@ public abstract class BaseHapiTerminologySvc implements IHapiTerminologySvc {
Collection<Long> parentLinks = myConceptParentChildLinkDao.findAllWithChild(theConceptPid); Collection<Long> parentLinks = myConceptParentChildLinkDao.findAllWithChild(theConceptPid);
if (parentLinks.isEmpty()) { if (parentLinks.isEmpty()) {
myChildToParentPidCache.put(theConceptPid, -1L); myChildToParentPidCache.put(theConceptPid, -1L);
ourLog.info("Found {} parent concepts of concept {} (cache has {})", 0, theConceptPid, myChildToParentPidCache.size());
return; return;
} else { } else {
for (Long next : parentLinks) { for (Long next : parentLinks) {
myChildToParentPidCache.put(theConceptPid, next); 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); createParentsString(theParentsBuilder, nextParent);
} }
int parentCount = myChildToParentPidCache.get(theConceptPid).size();
ourLog.info("Found {} parent concepts of concept {} (cache has {})", parentCount, theConceptPid, myChildToParentPidCache.size());
} }
@Override @Override
@ -390,8 +390,8 @@ public abstract class BaseHapiTerminologySvc implements IHapiTerminologySvc {
ourLog.info("Clearing parent concept cache"); ourLog.info("Clearing parent concept cache");
myNextReindexPass = System.currentTimeMillis() + DateUtils.MILLIS_PER_MINUTE; myNextReindexPass = System.currentTimeMillis() + DateUtils.MILLIS_PER_MINUTE;
myChildToParentPidCache = null; myChildToParentPidCache = null;
return;
} }
return;
} }
if (myChildToParentPidCache == null) { if (myChildToParentPidCache == null) {