diff --git a/defaults/yacy.init b/defaults/yacy.init index 10cef80b3..1c80ab643 100644 --- a/defaults/yacy.init +++ b/defaults/yacy.init @@ -494,7 +494,7 @@ proxyIndexingLocalMedia=true # Be careful with this number. Consider a branching factor of average 20; # A prefetch-depth of 8 would index 25.600.000.000 pages, maybe the whole WWW. crawlingDepth=3 -crawlingIfOlder=525600 +crawlingIfOlder=-1 crawlingDomFilterDepth=-1 crawlingDomMaxPages=-1 indexText=true diff --git a/source/de/anomic/kelondro/kelondroMScoreCluster.java b/source/de/anomic/kelondro/kelondroMScoreCluster.java index a31176b60..b1d664b6e 100644 --- a/source/de/anomic/kelondro/kelondroMScoreCluster.java +++ b/source/de/anomic/kelondro/kelondroMScoreCluster.java @@ -54,11 +54,14 @@ public final class kelondroMScoreCluster { * shrink the cluster to a demanded size * @param maxsize */ - public void shrinkToMaxSize(int maxsize) { + public synchronized void shrinkToMaxSize(int maxsize) { if (maxsize < 0) return; + Long key; while (refkeyDB.size() > maxsize) { // find and remove smallest objects until cluster has demanded size - refkeyDB.remove(keyrefDB.remove(keyrefDB.firstKey())); + key = keyrefDB.firstKey(); + if (key == null) break; + refkeyDB.remove(keyrefDB.remove(key)); } } @@ -66,12 +69,13 @@ public final class kelondroMScoreCluster { * shrink the cluster in such a way that the smallest score is equal or greater than a given minScore * @param minScore */ - public void shrinkToMinScore(int minScore) { + public synchronized void shrinkToMinScore(int minScore) { int score; Long key; while (true) { // find and remove objects where their score is smaller than the demanded minimum score key = keyrefDB.firstKey(); + if (key == null) break; score = (int) ((key.longValue() & 0xFFFFFFFF00000000L) >> 32); if (score >= minScore) break; refkeyDB.remove(keyrefDB.remove(key));