From 1d41ebf489c5d52bb51e41c05108cc79649ba86b Mon Sep 17 00:00:00 2001 From: auron_x Date: Fri, 22 Jun 2007 10:42:29 +0000 Subject: [PATCH] *) made age for deletion of too old seeds configurable *) changed naming-scheme of seed-deletion-properties git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3918 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/plasma/plasmaSwitchboard.java | 8 ++++---- yacy.init | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java index 3f8a3e047..0217cf71f 100644 --- a/source/de/anomic/plasma/plasmaSwitchboard.java +++ b/source/de/anomic/plasma/plasmaSwitchboard.java @@ -255,7 +255,6 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser public int totalPPM = 0; public double totalQPM = 0d; public TreeMap clusterhashes; // map of peerhash(String)/alternative-local-address as ip:port or only ip (String) or null if address in seed should be used - public long maxLastSeen = 604800000; // maximum time (in ms) a peer may not have been seen before it is removed from passive and potential dbs /* * Remote Proxy configuration @@ -1930,7 +1929,8 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser } catch (IOException e) {} // clean up seed-dbs - if(!getConfigBool("never_delete_old_seeds",false)) { + if(getConfigBool("routing.deleteOldSeeds.permission",true)) { + final long deleteOldSeedsTime = getConfigLong("routing.deleteOldSeeds.time",7)*24*3600000; Enumeration e = yacyCore.seedDB.seedsSortedDisconnected(true,yacySeed.LASTSEEN); yacySeed seed = null; ArrayList deleteQueue = new ArrayList(); @@ -1940,7 +1940,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser seed = (yacySeed)e.nextElement(); if(seed != null) { //list is sorted -> break when peers are too young to delete - if(seed.getLastSeenUTC() > (System.currentTimeMillis()-maxLastSeen)) + if(seed.getLastSeenUTC() > (System.currentTimeMillis()-deleteOldSeedsTime)) break; deleteQueue.add(seed.hash); } @@ -1954,7 +1954,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser seed = (yacySeed)e.nextElement(); if(seed != null) { //list is sorted -> break when peers are too young to delete - if(seed.getLastSeenUTC() > (System.currentTimeMillis()-maxLastSeen)) + if(seed.getLastSeenUTC() > (System.currentTimeMillis()-deleteOldSeedsTime)) break; deleteQueue.add(seed.hash); } diff --git a/yacy.init b/yacy.init index d28491f4b..6a88b0806 100644 --- a/yacy.init +++ b/yacy.init @@ -935,5 +935,9 @@ httpd.robots.txt = locked,dirs # class to use for parsing wikicode wikiParser.class = de.anomic.data.wikiCode -# if true the passive and potential Seed-dbs will never be cleaned from old (lastseen > 7 days) peers -never_delete_old_seeds = false \ No newline at end of file +# settings for automatic deletion of old entries in passive and potential seed-db +# time means max time (in days) a peer may not have been seen before it is deleted +routing.deleteOldSeeds.permission = true +routing.deleteOldSeeds.permission__pro = false +routing.deleteOldSeeds.time = 7 +routing.deleteOldSeeds.time__pro = 30 \ No newline at end of file