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

[tor-commits] [torflow/master] Write out the newest scanner's timestamp instead of the last numerical scanner's timestamp



commit 1661daab85791068c771e75fc848d76019e1d457
Author: Tom Ritter <tom@xxxxxxxxx>
Date:   Tue Mar 7 15:45:44 2017 -0600

    Write out the newest scanner's timestamp instead of the last numerical scanner's timestamp
---
 NetworkScanners/BwAuthority/aggregate.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/NetworkScanners/BwAuthority/aggregate.py b/NetworkScanners/BwAuthority/aggregate.py
index 01ea8b5..2a675e5 100755
--- a/NetworkScanners/BwAuthority/aggregate.py
+++ b/NetworkScanners/BwAuthority/aggregate.py
@@ -855,10 +855,12 @@ def main(argv):
   n_print = nodes.values()
   n_print.sort(lambda x,y: int(y.pid_error*1000) - int(x.pid_error*1000))
 
+  scan_age = 0
   for scanner in scanner_timestamps.iterkeys():
-    scan_age = int(round(scanner_timestamps[scanner],0))
-    if scan_age < time.time() - MAX_SCAN_AGE:
-      plog("WARN", "Bandwidth scanner "+scanner+" stale. Possible dead bwauthority.py. Timestamp: "+time.ctime(scan_age))
+    this_scan_age = int(round(scanner_timestamps[scanner],0))
+    scan_age = scan_age if scan_age > this_scan_age else this_scan_age
+    if this_scan_age < time.time() - MAX_SCAN_AGE:
+      plog("WARN", "Bandwidth scanner "+scanner+" stale. Possible dead bwauthority.py. Timestamp: "+time.ctime(this_scan_age))
 
   out = file(argv[-1], "w")
   out.write(str(scan_age)+"\n")



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