[VIVO-1262] Minor correction in the visualisation cache

This commit is contained in:
Graham Triggs 2016-08-18 06:59:13 -06:00
parent 3bafa451f2
commit 1dbfffa2c8

View file

@ -90,11 +90,16 @@ public class CachingRDFServiceExecutor<T> {
if (cachedResults != null) { if (cachedResults != null) {
// If the background service exists, and the cache is considered invalid // If the background service exists, and the cache is considered invalid
if (backgroundRDFService != null && resultBuilder.invalidateCache(System.currentTimeMillis() - lastCacheTime)) { if (backgroundRDFService != null && resultBuilder.invalidateCache(System.currentTimeMillis() - lastCacheTime)) {
// Determine how long we are prepared to wait for an answer // In most cases, only wait for half a second
long waitFor = (backgroundTask == null ? 1000 : 500); long waitFor = 500;
// Start the background task to refresh the cache if (backgroundTask == null) {
startBackgroundTask(rdfService); // Start the background task to refresh the cache
startBackgroundTask(backgroundRDFService);
// As we've just started the background task, allow a wait time of 1 second
waitFor = 1000;
}
// See if we expect it to complete in time, and if so, wait for it // See if we expect it to complete in time, and if so, wait for it
if (allowWaits && isExpectedToCompleteIn(waitFor)) { if (allowWaits && isExpectedToCompleteIn(waitFor)) {