Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
- changed default values for online caution (the pausing may not be necessary any more) - fixed bug in WeakPriorityBlockingQueue - show favicon faster using pre-loading (same technique as used for fast image search)
orbiter4c21d8dc9d01
diff --git a/defaults/yacy.init b/defaults/yacy.initindex 8664f0d6e..d252764d6 100644--- a/defaults/yacy.init+++ b/defaults/yacy.init@@ -663,9 +663,9 @@ msgForwardingCmd=/usr/sbin/sendmailmsgForwardingTo=root@localhost#crawlPause: delay time after specific functions before crawling is resumed-crawlPause.proxy=15000-crawlPause.localsearch=9000-crawlPause.remotesearch=3000+crawlPause.proxy=100+crawlPause.localsearch=1000+crawlPause.remotesearch=500# Some configuration values for the crawlercrawler.clientTimeout=9000diff --git a/htroot/yacysearchitem.java b/htroot/yacysearchitem.javaindex a524561b8..4c72c8fd6 100644--- a/htroot/yacysearchitem.java+++ b/htroot/yacysearchitem.java@@ -74,6 +74,7 @@ public class yacysearchitem {prop.put("references", "0");prop.put("rssreferences", "0");prop.put("dynamic", "0");+ boolean isHtml = header.get(HeaderFramework.CONNECTION_PROP_PATH).endsWith(".html");// find search eventfinal SearchEvent theSearch = SearchEventCache.getEvent(eventID);@@ -123,6 +124,7 @@ public class yacysearchitem {prop.putJSON("content_title-json", result.title());prop.putHTML("content_link", result.urlstring());prop.put("content_display", display);+ if (isHtml) sb.loader.loadIfNotExistBackground(faviconURL.toNormalform(true, false), 1024 * 1024 * 10);prop.putHTML("content_faviconCode", sb.licensedURLs.aquireLicense(faviconURL)); // aquire license for favicon url loadingprop.put("content_urlhash", resulthashString);prop.put("content_urlhexhash", yacySeed.b64Hash2hexHash(resulthashString));diff --git a/source/de/anomic/search/Switchboard.java b/source/de/anomic/search/Switchboard.javaindex 902f907ec..07741f8a7 100644--- a/source/de/anomic/search/Switchboard.java+++ b/source/de/anomic/search/Switchboard.java@@ -1073,9 +1073,9 @@ public final class Switchboard extends serverSwitch {* @return*/public String onlineCaution() {- if (System.currentTimeMillis() - this.proxyLastAccess < Integer.parseInt(getConfig(SwitchboardConstants.PROXY_ONLINE_CAUTION_DELAY, "30000"))) return "proxy";- if (System.currentTimeMillis() - this.localSearchLastAccess < Integer.parseInt(getConfig(SwitchboardConstants.LOCALSEACH_ONLINE_CAUTION_DELAY, "30000"))) return "localsearch";- if (System.currentTimeMillis() - this.remoteSearchLastAccess < Integer.parseInt(getConfig(SwitchboardConstants.REMOTESEARCH_ONLINE_CAUTION_DELAY, "30000"))) return"remotesearch";+ if (System.currentTimeMillis() - this.proxyLastAccess < Integer.parseInt(getConfig(SwitchboardConstants.PROXY_ONLINE_CAUTION_DELAY, "100"))) return "proxy";+ if (System.currentTimeMillis() - this.localSearchLastAccess < Integer.parseInt(getConfig(SwitchboardConstants.LOCALSEACH_ONLINE_CAUTION_DELAY, "1000"))) return "localsearch";+ if (System.currentTimeMillis() - this.remoteSearchLastAccess < Integer.parseInt(getConfig(SwitchboardConstants.REMOTESEARCH_ONLINE_CAUTION_DELAY, "500"))) return"remotesearch";return null;}diff --git a/source/net/yacy/cora/storage/WeakPriorityBlockingQueue.java b/source/net/yacy/cora/storage/WeakPriorityBlockingQueue.javaindex ad7fe0093..e637c24c9 100644--- a/source/net/yacy/cora/storage/WeakPriorityBlockingQueue.java+++ b/source/net/yacy/cora/storage/WeakPriorityBlockingQueue.java@@ -115,13 +115,12 @@ public class WeakPriorityBlockingQueue<E> {if (this.drained.contains(element)) return;if (this.queue.size() == this.maxsize) {// remove last elements if stack is too large- this.queue.remove(this.queue.last());- this.queue.add(element);+ if (this.queue.add(element)) this.queue.remove(this.queue.last());} else {- this.queue.add(element);- this.enqueued.release();+ // just add entry but only release semaphore if entry was not double+ if (this.queue.add(element)) this.enqueued.release();}- assert this.queue.size() >= this.enqueued.availablePermits() : "queue.size() = " + this.queue.size() + ", enqueued.availablePermits() = " + this.enqueued.availablePermits();+ assert this.queue.size() >= this.enqueued.availablePermits() : "(put) queue.size() = " + this.queue.size() + ", enqueued.availablePermits() = " + this.enqueued.availablePermits();}/**@@ -166,7 +165,7 @@ public class WeakPriorityBlockingQueue<E> {assert element != null;this.queue.remove(element);this.drained.add(element);- assert this.queue.size() >= this.enqueued.availablePermits() : "queue.size() = " + this.queue.size() + ", enqueued.availablePermits() = " + this.enqueued.availablePermits();+ assert this.queue.size() >= this.enqueued.availablePermits() : "(take) queue.size() = " + this.queue.size() + ", enqueued.availablePermits() = " + this.enqueued.availablePermits();return element;}