- 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)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7130 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 15 years ago
parent 570ca577c6
commit 4c21d8dc9d

@ -663,9 +663,9 @@ msgForwardingCmd=/usr/sbin/sendmail
msgForwardingTo=root@localhost msgForwardingTo=root@localhost
#crawlPause: delay time after specific functions before crawling is resumed #crawlPause: delay time after specific functions before crawling is resumed
crawlPause.proxy=15000 crawlPause.proxy=100
crawlPause.localsearch=9000 crawlPause.localsearch=1000
crawlPause.remotesearch=3000 crawlPause.remotesearch=500
# Some configuration values for the crawler # Some configuration values for the crawler
crawler.clientTimeout=9000 crawler.clientTimeout=9000

@ -74,6 +74,7 @@ public class yacysearchitem {
prop.put("references", "0"); prop.put("references", "0");
prop.put("rssreferences", "0"); prop.put("rssreferences", "0");
prop.put("dynamic", "0"); prop.put("dynamic", "0");
boolean isHtml = header.get(HeaderFramework.CONNECTION_PROP_PATH).endsWith(".html");
// find search event // find search event
final SearchEvent theSearch = SearchEventCache.getEvent(eventID); final SearchEvent theSearch = SearchEventCache.getEvent(eventID);
@ -123,6 +124,7 @@ public class yacysearchitem {
prop.putJSON("content_title-json", result.title()); prop.putJSON("content_title-json", result.title());
prop.putHTML("content_link", result.urlstring()); prop.putHTML("content_link", result.urlstring());
prop.put("content_display", display); 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 loading prop.putHTML("content_faviconCode", sb.licensedURLs.aquireLicense(faviconURL)); // aquire license for favicon url loading
prop.put("content_urlhash", resulthashString); prop.put("content_urlhash", resulthashString);
prop.put("content_urlhexhash", yacySeed.b64Hash2hexHash(resulthashString)); prop.put("content_urlhexhash", yacySeed.b64Hash2hexHash(resulthashString));

@ -1073,9 +1073,9 @@ public final class Switchboard extends serverSwitch {
* @return * @return
*/ */
public String onlineCaution() { public String onlineCaution() {
if (System.currentTimeMillis() - this.proxyLastAccess < Integer.parseInt(getConfig(SwitchboardConstants.PROXY_ONLINE_CAUTION_DELAY, "30000"))) return "proxy"; 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, "30000"))) return "localsearch"; 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, "30000"))) return"remotesearch"; if (System.currentTimeMillis() - this.remoteSearchLastAccess < Integer.parseInt(getConfig(SwitchboardConstants.REMOTESEARCH_ONLINE_CAUTION_DELAY, "500"))) return"remotesearch";
return null; return null;
} }

@ -115,13 +115,12 @@ public class WeakPriorityBlockingQueue<E> {
if (this.drained.contains(element)) return; if (this.drained.contains(element)) return;
if (this.queue.size() == this.maxsize) { if (this.queue.size() == this.maxsize) {
// remove last elements if stack is too large // remove last elements if stack is too large
this.queue.remove(this.queue.last()); if (this.queue.add(element)) this.queue.remove(this.queue.last());
this.queue.add(element);
} else { } else {
this.queue.add(element); // just add entry but only release semaphore if entry was not double
this.enqueued.release(); 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; assert element != null;
this.queue.remove(element); this.queue.remove(element);
this.drained.add(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; return element;
} }

Loading…
Cancel
Save