|
|
|
@ -98,7 +98,7 @@ public class yacyCore {
|
|
|
|
|
|
|
|
|
|
// class variables
|
|
|
|
|
private int lastSeedUpload_seedDBSize = 0;
|
|
|
|
|
public static long lastSeedUpload_timeStamp = System.currentTimeMillis();
|
|
|
|
|
public long lastSeedUpload_timeStamp = System.currentTimeMillis();
|
|
|
|
|
private String lastSeedUpload_myPeerType = "";
|
|
|
|
|
private String lastSeedUpload_myIP = "";
|
|
|
|
|
|
|
|
|
@ -238,7 +238,7 @@ public class yacyCore {
|
|
|
|
|
(this.lastSeedUpload_myIP.equals(seedDB.mySeed.get("IP", "127.0.0.1"))) &&
|
|
|
|
|
(this.lastSeedUpload_seedDBSize == seedDB.sizeConnected()) &&
|
|
|
|
|
(canReachMyself()) &&
|
|
|
|
|
(System.currentTimeMillis() - yacyCore.lastSeedUpload_timeStamp < 1000*60*60*24) &&
|
|
|
|
|
(System.currentTimeMillis() - this.lastSeedUpload_timeStamp < 1000*60*60*24) &&
|
|
|
|
|
(seedDB.mySeed.isPrincipal())
|
|
|
|
|
) {
|
|
|
|
|
log.logDebug("yacyCore.publishSeedList: not necessary to publish: oldIP is equal, sizeConnected is equal and I can reach myself under the old IP.");
|
|
|
|
@ -261,13 +261,6 @@ public class yacyCore {
|
|
|
|
|
}
|
|
|
|
|
// we want to be a principal...
|
|
|
|
|
saveSeedList();
|
|
|
|
|
|
|
|
|
|
this.lastSeedUpload_seedDBSize = seedDB.sizeConnected();
|
|
|
|
|
this.lastSeedUpload_timeStamp = System.currentTimeMillis();
|
|
|
|
|
|
|
|
|
|
this.lastSeedUpload_myIP = seedDB.mySeed.get("IP", "127.0.0.1");
|
|
|
|
|
this.lastSeedUpload_myPeerType = seedDB.mySeed.get("PeerType", yacySeed.PEERTYPE_JUNIOR);
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
if (seedUploadMethod.equals("")) this.switchboard.setConfig("seedUploadMethod","none");
|
|
|
|
|
log.logDebug("yacyCore.publishSeedList: No uploading method configured");
|
|
|
|
@ -629,7 +622,8 @@ public class yacyCore {
|
|
|
|
|
return saveSeedList(this.switchboard);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static String saveSeedList(serverSwitch sb) {
|
|
|
|
|
public String saveSeedList(serverSwitch sb) {
|
|
|
|
|
try {
|
|
|
|
|
// return an error if this is not successful, and NULL if everything is fine
|
|
|
|
|
String logt;
|
|
|
|
|
|
|
|
|
@ -715,6 +709,13 @@ public class yacyCore {
|
|
|
|
|
log.logInfo(errorMsg);
|
|
|
|
|
return errorMsg;
|
|
|
|
|
}
|
|
|
|
|
} finally {
|
|
|
|
|
this.lastSeedUpload_seedDBSize = seedDB.sizeConnected();
|
|
|
|
|
this.lastSeedUpload_timeStamp = System.currentTimeMillis();
|
|
|
|
|
|
|
|
|
|
this.lastSeedUpload_myIP = seedDB.mySeed.get("IP", "127.0.0.1");
|
|
|
|
|
this.lastSeedUpload_myPeerType = seedDB.mySeed.get("PeerType", yacySeed.PEERTYPE_JUNIOR);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|