Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

some enhancements to the remote crawl trigger

orbiter60e5aff9fc91
diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java
index 3afa54b77..86c3d086d 100644
--- a/source/de/anomic/plasma/plasmaSwitchboard.java
+++ b/source/de/anomic/plasma/plasmaSwitchboard.java
@@ -1161,19 +1161,6 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
log.logInfo("shifted " + toshift + " jobs from global crawl to local crawl");
}
-
- if (sbQueue.size() >= indexingSlots) {
- log.logFine("LimitCrawl: too many processes in indexing queue, dismissed to protect emergency case (" +
- "sbQueueSize=" + sbQueue.size() + ")");
- return false;
- }
- if (cacheLoader.size() >= crawlSlots) {
- log.logFine("LimitCrawl: too many processes in loader queue, dismissed to protect emergency case (" +
- "cacheLoader=" + cacheLoader.size() + ")");
- return false;
- }
-
-
// if the server is busy, we do crawling more slowly
//if (!(cacheManager.idle())) try {Thread.currentThread().sleep(2000);} catch (InterruptedException e) {}
@@ -1214,7 +1201,20 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
if (success) return true;
}
- processLocalCrawling(urlEntry, profile, stats);
+ processLocalCrawling(urlEntry, profile, stats); // emergency case
+
+ if (sbQueue.size() >= indexingSlots) {
+ log.logFine("LimitCrawl: too many processes in indexing queue, delayed to protect emergency case (" +
+ "sbQueueSize=" + sbQueue.size() + ")");
+ return false;
+ }
+
+ if (cacheLoader.size() >= crawlSlots) {
+ log.logFine("LimitCrawl: too many processes in loader queue, delayed to protect emergency case (" +
+ "cacheLoader=" + cacheLoader.size() + ")");
+ return false;
+ }
+
return true;
} catch (IOException e) {
log.logSevere(stats + ": CANNOT FETCH ENTRY: " + e.getMessage());
@@ -1706,7 +1706,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
// do the request
try {
- HashMap page = yacyClient.crawlOrder(remoteSeed, urlEntry.url(), urlPool.getURL(urlEntry.referrerHash()));
+ HashMap page = yacyClient.crawlOrder(remoteSeed, urlEntry.url(), urlPool.getURL(urlEntry.referrerHash()), 6000);
// check success
/*
diff --git a/source/de/anomic/yacy/yacyClient.java b/source/de/anomic/yacy/yacyClient.java
index 727b2e007..5ba9633ed 100644
--- a/source/de/anomic/yacy/yacyClient.java
+++ b/source/de/anomic/yacy/yacyClient.java
@@ -733,11 +733,11 @@ public final class yacyClient {
return "wrong protocol: " + protocol;
}
- public static HashMap crawlOrder(yacySeed targetSeed, URL url, URL referrer) {
- return crawlOrder(targetSeed,new URL[]{url},new URL[]{referrer});
+ public static HashMap crawlOrder(yacySeed targetSeed, URL url, URL referrer, int timeout) {
+ return crawlOrder(targetSeed, new URL[]{url}, new URL[]{referrer}, timeout);
}
- public static HashMap crawlOrder(yacySeed targetSeed, URL[] url, URL[] referrer) {
+ public static HashMap crawlOrder(yacySeed targetSeed, URL[] url, URL[] referrer, int timeout) {
// this post a message to the remote message board
if (targetSeed == null) { return null; }
if (yacyCore.seedDB.mySeed == null) { return null; }
@@ -777,7 +777,7 @@ public final class yacyClient {
return nxTools.table(
httpc.wput(
new URL("http://" + address + "/yacy/crawlOrder.html"),
- 60000,
+ timeout,
null,
null,
(useProxy)?yacyCore.seedDB.sb.remoteProxyConfig:null,