configuration of time-out for fetching seed-lists during bootstraping

(weil das beim linuxtag nur auf meinem Notebook nicht funtioniert)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2054 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 19 years ago
parent 11ab368405
commit fe4ad214f1

@ -74,6 +74,7 @@ public class yacyPeerActions {
public long seniorConnects; public long seniorConnects;
public long principalConnects; public long principalConnects;
public long disconnects; public long disconnects;
private int bootstrapLoadTimeout;
public yacyPeerActions(yacySeedDB seedDB, plasmaSwitchboard switchboard, File superseedFile, String superseedURL) { public yacyPeerActions(yacySeedDB seedDB, plasmaSwitchboard switchboard, File superseedFile, String superseedURL) {
this.seedDB = seedDB; this.seedDB = seedDB;
@ -87,6 +88,7 @@ public class yacyPeerActions {
this.seniorConnects = 0; this.seniorConnects = 0;
this.principalConnects = 0; this.principalConnects = 0;
this.disconnects = 0; this.disconnects = 0;
this.bootstrapLoadTimeout = (int) switchboard.getConfigLong("bootstrapLoadTimeout", 6000);
} }
public void deploy(yacyPeerAction action) { public void deploy(yacyPeerAction action) {
@ -181,14 +183,14 @@ public class yacyPeerActions {
reqHeader.put(httpHeader.CACHE_CONTROL,"no-cache"); reqHeader.put(httpHeader.CACHE_CONTROL,"no-cache");
url = new URL(seedListFileURL); url = new URL(seedListFileURL);
header = httpc.whead(url, 5000, null, null, this.sb.remoteProxyConfig,reqHeader); header = httpc.whead(url, this.bootstrapLoadTimeout, null, null, this.sb.remoteProxyConfig,reqHeader);
if ((header == null) || (header.lastModified() == null)) { if ((header == null) || (header.lastModified() == null)) {
yacyCore.log.logInfo("BOOTSTRAP: seed-list URL " + seedListFileURL + " not available"); yacyCore.log.logInfo("BOOTSTRAP: seed-list URL " + seedListFileURL + " not available");
} else if ((header.age() > 86400000) && (ssc > 0)) { } else if ((header.age() > 86400000) && (ssc > 0)) {
yacyCore.log.logInfo("BOOTSTRAP: seed-list URL " + seedListFileURL + " too old (" + (header.age() / 86400000) + " days)"); yacyCore.log.logInfo("BOOTSTRAP: seed-list URL " + seedListFileURL + " too old (" + (header.age() / 86400000) + " days)");
} else { } else {
ssc++; ssc++;
seedList = httpc.wget(url, 5000, null, null, this.sb.remoteProxyConfig,reqHeader); seedList = httpc.wget(url, this.bootstrapLoadTimeout, null, null, this.sb.remoteProxyConfig,reqHeader);
enu = seedList.iterator(); enu = seedList.iterator();
lc = 0; lc = 0;
while (enu.hasNext()) { while (enu.hasNext()) {

@ -38,6 +38,14 @@ port = 8080
superseedFile=superseed.txt superseedFile=superseed.txt
superseedLocation=http://www.yacy.net/superseed.txt superseedLocation=http://www.yacy.net/superseed.txt
# bootstrapLoadTimeout
# this is the time-out for loading of the seedlist files during bootstraping
# the time may not too long, since loading of the seedlist is not parallelized
# and a not successful loading of a seed file may prevent a peer from becoming
# a (at least) junior status. If the time-out is too short, there is the danger
# that the peer stays in virgin mode
bootstrapLoadTimeout = 6000
# time-out of client control socket in milliseconds # time-out of client control socket in milliseconds
# since this applies only to the client-proxy connection, # since this applies only to the client-proxy connection,
# it can be rather short # it can be rather short

Loading…
Cancel
Save