Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
removed more unnecessary exist-checks in ErrorCache
Michael Peter Christenfd87fa1613e2
diff --git a/source/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnector.java b/source/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnector.javaindex db3f95434..8fda40feb 100644--- a/source/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnector.java+++ b/source/net/yacy/cora/federate/solr/connector/EmbeddedSolrConnector.java@@ -417,7 +417,9 @@ public class EmbeddedSolrConnector extends SolrServerConnector implements SolrCoif (doc == null) return null;return AbstractSolrConnector.getMetadata(doc);//}- } catch (Throwable e) {} finally {+ } catch (Throwable e) {+ ConcurrentLog.logException(e);+ } finally {if (docListSearcher != null) docListSearcher.close();}return null;diff --git a/source/net/yacy/search/index/ErrorCache.java b/source/net/yacy/search/index/ErrorCache.javaindex b8828b918..9b19217c4 100644--- a/source/net/yacy/search/index/ErrorCache.java+++ b/source/net/yacy/search/index/ErrorCache.java@@ -109,7 +109,7 @@ public class ErrorCache {url, profile == null ? null : profile.collections(),failCategory.name() + " " + reason, failCategory.failType,httpcode, crawldepth);- if (this.fulltext.getDefaultConnector() != null && failCategory.store && !exists(url.hash())) {+ if (this.fulltext.getDefaultConnector() != null && failCategory.store) {// send the error to solrtry {// do not overwrite error reports with error reports@@ -189,12 +189,10 @@ public class ErrorCache {public boolean exists(final byte[] urlHash) {String urlHashString = ASCII.String(urlHash);try {- // first try to check if the document exists at all.- long loaddate = this.fulltext.getLoadTime(urlHashString);- if (loaddate < 0) return false;- // then load the fail reason, if exists+ // load the fail reason, if existsfinal SolrDocument doc = this.fulltext.getDefaultConnector().getDocumentById(urlHashString, CollectionSchema.failreason_s.getSolrFieldName());if (doc == null) return false;+// check if the document contains a value in the field CollectionSchema.failreason_sObject failreason = doc.getFieldValue(CollectionSchema.failreason_s.getSolrFieldName());return failreason != null && failreason.toString().length() > 0;