[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [metrics-db/master] Prepare for running relay descriptor downloader twice per hour.



commit a2db139da101941d5c8e13b6c426093e62f3de3b
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Fri Oct 26 15:32:02 2012 -0400

    Prepare for running relay descriptor downloader twice per hour.
---
 .../db/bridgedescs/SanitizedBridgesWriter.java     |    7 +++++++
 .../BridgePoolAssignmentsProcessor.java            |    7 +++++++
 .../ernie/db/exitlists/ExitListDownloader.java     |    7 +++++++
 .../ernie/db/torperf/TorperfDownloader.java        |    6 ++++++
 4 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/src/org/torproject/ernie/db/bridgedescs/SanitizedBridgesWriter.java b/src/org/torproject/ernie/db/bridgedescs/SanitizedBridgesWriter.java
index cb08df1..8db267a 100644
--- a/src/org/torproject/ernie/db/bridgedescs/SanitizedBridgesWriter.java
+++ b/src/org/torproject/ernie/db/bridgedescs/SanitizedBridgesWriter.java
@@ -81,6 +81,13 @@ public class SanitizedBridgesWriter extends Thread {
   private SecureRandom secureRandom;
 
   public void run() {
+
+    if (((System.currentTimeMillis() / 60000L) % 60L) > 30L) {
+      /* Don't start in second half of an hour, when we only want to
+       * process other data. */
+      return;
+    }
+
     File bridgeDirectoriesDirectory =
         new File(config.getBridgeSnapshotsDirectory());
     File sanitizedBridgesDirectory =
diff --git a/src/org/torproject/ernie/db/bridgepools/BridgePoolAssignmentsProcessor.java b/src/org/torproject/ernie/db/bridgepools/BridgePoolAssignmentsProcessor.java
index d822d11..4f8dcb6 100644
--- a/src/org/torproject/ernie/db/bridgepools/BridgePoolAssignmentsProcessor.java
+++ b/src/org/torproject/ernie/db/bridgepools/BridgePoolAssignmentsProcessor.java
@@ -38,6 +38,13 @@ public class BridgePoolAssignmentsProcessor extends Thread {
   }
 
   public void run() {
+
+    if (((System.currentTimeMillis() / 60000L) % 60L) > 30L) {
+      /* Don't start in second half of an hour, when we only want to
+       * process other data. */
+      return;
+    }
+
     File assignmentsDirectory =
         new File(config.getAssignmentsDirectory());
     File sanitizedAssignmentsDirectory =
diff --git a/src/org/torproject/ernie/db/exitlists/ExitListDownloader.java b/src/org/torproject/ernie/db/exitlists/ExitListDownloader.java
index bf67bb7..bbd93ac 100644
--- a/src/org/torproject/ernie/db/exitlists/ExitListDownloader.java
+++ b/src/org/torproject/ernie/db/exitlists/ExitListDownloader.java
@@ -27,6 +27,13 @@ public class ExitListDownloader extends Thread {
   }
 
   public void run() {
+
+    if (((System.currentTimeMillis() / 60000L) % 60L) > 30L) {
+      /* Don't start in second half of an hour, when we only want to
+       * process other data. */
+      return;
+    }
+
     Logger logger = Logger.getLogger(ExitListDownloader.class.getName());
     try {
       logger.fine("Downloading exit list...");
diff --git a/src/org/torproject/ernie/db/torperf/TorperfDownloader.java b/src/org/torproject/ernie/db/torperf/TorperfDownloader.java
index ef67ae7..143010c 100644
--- a/src/org/torproject/ernie/db/torperf/TorperfDownloader.java
+++ b/src/org/torproject/ernie/db/torperf/TorperfDownloader.java
@@ -42,6 +42,12 @@ public class TorperfDownloader extends Thread {
 
   public void run() {
 
+    if (((System.currentTimeMillis() / 60000L) % 60L) > 30L) {
+      /* Don't start in second half of an hour, when we only want to
+       * process other data. */
+      return;
+    }
+
     File torperfOutputDirectory =
         new File(config.getTorperfOutputDirectory());
     SortedMap<String, String> torperfSources = config.getTorperfSources();



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits