change to prevent foreground recompute when only annotations are updated
This commit is contained in:
parent
f8616d4c85
commit
cfada56e31
1 changed files with 16 additions and 5 deletions
|
@ -67,8 +67,10 @@ public class KnowledgeBaseUpdater {
|
||||||
log.info("Performing any necessary data migration");
|
log.info("Performing any necessary data migration");
|
||||||
logger.log("Started knowledge base migration");
|
logger.log("Started knowledge base migration");
|
||||||
|
|
||||||
|
boolean changesPerformed = false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
performUpdate(servletContext);
|
changesPerformed = performUpdate(servletContext);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.logError(e.getMessage());
|
logger.logError(e.getMessage());
|
||||||
log.error(e,e);
|
log.error(e,e);
|
||||||
|
@ -85,12 +87,20 @@ public class KnowledgeBaseUpdater {
|
||||||
long elapsedSecs = (System.currentTimeMillis() - startTime)/1000;
|
long elapsedSecs = (System.currentTimeMillis() - startTime)/1000;
|
||||||
log.info("Finished checking knowledge base in " + elapsedSecs + " second" + (elapsedSecs != 1 ? "s" : ""));
|
log.info("Finished checking knowledge base in " + elapsedSecs + " second" + (elapsedSecs != 1 ? "s" : ""));
|
||||||
|
|
||||||
return record.hasRecordedChanges();
|
// The following was removed because it forced a recompute even if only
|
||||||
|
// annotation values changed:
|
||||||
|
// return record.hasRecordedChanges();
|
||||||
|
|
||||||
|
return changesPerformed;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void performUpdate(ServletContext servletContext) throws Exception {
|
// returns true if ontology changes were found
|
||||||
|
private boolean performUpdate(ServletContext servletContext) throws Exception {
|
||||||
|
|
||||||
List<AtomicOntologyChange> rawChanges = getAtomicOntologyChanges();
|
List<AtomicOntologyChange> rawChanges = getAtomicOntologyChanges();
|
||||||
|
if (rawChanges.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
AtomicOntologyChangeLists changes = new AtomicOntologyChangeLists(rawChanges,settings.getNewTBoxModel(),settings.getOldTBoxModel());
|
AtomicOntologyChangeLists changes = new AtomicOntologyChangeLists(rawChanges,settings.getNewTBoxModel(),settings.getOldTBoxModel());
|
||||||
|
|
||||||
|
@ -122,9 +132,10 @@ public class KnowledgeBaseUpdater {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error(e,e);
|
log.error(e,e);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final boolean ADD = true;
|
private static final boolean ADD = true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue