From 10ebcb5e1ea7f72ffbf8db550a09d0f2f889cd45 Mon Sep 17 00:00:00 2001 From: orbiter Date: Sat, 3 Feb 2007 11:22:23 +0000 Subject: [PATCH] fixed bug in disconnection time git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3326 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/yacy/yacyPeerActions.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/source/de/anomic/yacy/yacyPeerActions.java b/source/de/anomic/yacy/yacyPeerActions.java index 8e4a40167..5fd0f979a 100644 --- a/source/de/anomic/yacy/yacyPeerActions.java +++ b/source/de/anomic/yacy/yacyPeerActions.java @@ -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 } }