read snippets from cache in case they are not provided in RAM

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2700 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent b114def2f8
commit 630a955674

@ -201,11 +201,15 @@ public class plasmaSnippetCache {
// getting resource metadata (e.g. the http headers for http resources)
if (entry != null) docInfo = entry.getDocumentInfo();
// read resource body
// read resource body (if it is there)
resource = entry.cacheArray();
if (resource == null) {
return new Snippet(null, ERROR_RESOURCE_LOADING, "error loading resource, plasmaHTCache.Entry cache is NULL");
}
// in case that the reosurce was not in ram, read it from disk
if (resource == null) resource = this.cacheManager.loadResourceContent(url);
// if it is still not available, throw exception
if (resource == null) return new Snippet(null, ERROR_RESOURCE_LOADING, "error loading resource, plasmaHTCache.Entry cache is NULL");
source = SOURCE_WEB;
}
} catch (Exception e) {

Loading…
Cancel
Save