fixed bug in disconnection time

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3326 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 18 years ago
parent 02a73dce87
commit 10ebcb5e1e

@ -49,7 +49,6 @@ import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@ -323,11 +322,7 @@ public class yacyPeerActions {
if (disconnectedSeed == null) {
dtimeUTC0 = 0; // never disconnected: virtually disconnected maximum time ago
} else {
try {
dtimeUTC0 = yacyCore.parseUniversalDate(disconnectedSeed.get("disconnected", "20040101000000")).getTime() - seed.getUTCDiff();
} catch (java.text.ParseException e) {
dtimeUTC0 = 0;
}
dtimeUTC0 = Long.parseLong(disconnectedSeed.get("dct", "0"));
}
if (direct) {
@ -410,7 +405,7 @@ public class yacyPeerActions {
yacyCore.log.logFine("connect: no contact to a " + seed.get(yacySeed.PEERTYPE, yacySeed.PEERTYPE_VIRGIN) + " peer '" + seed.getName() + "' at " + seed.getAddress());
synchronized (seedDB) {
if (!seedDB.hasDisconnected(seed.hash)) { disconnects++; }
seed.put("disconnected", yacyCore.universalDateShortString(new Date()));
seed.put("dct", Long.toString(System.currentTimeMillis()));
seedDB.addDisconnected(seed); // update info
}
}

Loading…
Cancel
Save