commit 1ff4ce519f26fbdfd5cb3428ad7251e580764666 Author: Karsten Loesing karsten.loesing@gmx.net Date: Sun Apr 3 14:26:08 2011 +0200
Limit download of all descriptors to 2 authorities. --- .../ernie/db/RelayDescriptorDownloader.java | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/org/torproject/ernie/db/RelayDescriptorDownloader.java b/src/org/torproject/ernie/db/RelayDescriptorDownloader.java index 835d821..4b5d729 100644 --- a/src/org/torproject/ernie/db/RelayDescriptorDownloader.java +++ b/src/org/torproject/ernie/db/RelayDescriptorDownloader.java @@ -313,8 +313,8 @@ public class RelayDescriptorDownloader { } }
- /* Make a list of directory authorities that we want to download all - * server and extra-info descriptors from. */ + /* Make a list of at most two directory authorities that we want to + * download all server and extra-info descriptors from. */ this.downloadAllDescriptorsFromAuthorities = new HashSet<String>(); for (String authority : this.authorities) { if (!this.lastDownloadedAllDescriptors.containsKey(authority) || @@ -322,6 +322,9 @@ public class RelayDescriptorDownloader { this.downloadAllDescriptorsCutOff) < 0) { this.downloadAllDescriptorsFromAuthorities.add(authority); } + if (this.downloadAllDescriptorsFromAuthorities.size() >= 2) { + break; + } }
/* Prepare statistics on this execution. */ @@ -508,9 +511,6 @@ public class RelayDescriptorDownloader { /* Download all server or extra-info descriptors from this * authority if we haven't done so for 24 hours and if we're * configured to do so. */ - /* TODO Distribute downloads of all descriptors over the day for - * different authorities. Maybe limit the number of these - * downloads to 1 or 2 per execution. */ if (this.downloadAllDescriptorsFromAuthorities.contains( authority) && ((type.equals("server") && this.downloadAllServerDescriptors) ||
tor-commits@lists.torproject.org