*) 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
pull/1/head
auron_x 18 years ago
parent 52cb3208d0
commit 1d41ebf489

@ -255,7 +255,6 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
public int totalPPM = 0; public int totalPPM = 0;
public double totalQPM = 0d; 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 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 * Remote Proxy configuration
@ -1930,7 +1929,8 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
} catch (IOException e) {} } catch (IOException e) {}
// clean up seed-dbs // 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); Enumeration e = yacyCore.seedDB.seedsSortedDisconnected(true,yacySeed.LASTSEEN);
yacySeed seed = null; yacySeed seed = null;
ArrayList deleteQueue = new ArrayList(); ArrayList deleteQueue = new ArrayList();
@ -1940,7 +1940,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
seed = (yacySeed)e.nextElement(); seed = (yacySeed)e.nextElement();
if(seed != null) { if(seed != null) {
//list is sorted -> break when peers are too young to delete //list is sorted -> break when peers are too young to delete
if(seed.getLastSeenUTC() > (System.currentTimeMillis()-maxLastSeen)) if(seed.getLastSeenUTC() > (System.currentTimeMillis()-deleteOldSeedsTime))
break; break;
deleteQueue.add(seed.hash); deleteQueue.add(seed.hash);
} }
@ -1954,7 +1954,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
seed = (yacySeed)e.nextElement(); seed = (yacySeed)e.nextElement();
if(seed != null) { if(seed != null) {
//list is sorted -> break when peers are too young to delete //list is sorted -> break when peers are too young to delete
if(seed.getLastSeenUTC() > (System.currentTimeMillis()-maxLastSeen)) if(seed.getLastSeenUTC() > (System.currentTimeMillis()-deleteOldSeedsTime))
break; break;
deleteQueue.add(seed.hash); deleteQueue.add(seed.hash);
} }

@ -935,5 +935,9 @@ httpd.robots.txt = locked,dirs
# class to use for parsing wikicode # class to use for parsing wikicode
wikiParser.class = de.anomic.data.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 # settings for automatic deletion of old entries in passive and potential seed-db
never_delete_old_seeds = false # 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
Loading…
Cancel
Save