[tor-commits] [bridgedb/develop] Readd COLLECT_TIMESTAMPS in Main.load()
isis at torproject.org
isis at torproject.org
Thu Mar 13 23:17:19 UTC 2014
commit b0e7ef1a5eb4f358d1ad39a6500ec1a43bc09d57
Author: Matthew Finkel <Matthew.Finkel at gmail.com>
Date: Thu Mar 13 12:39:36 2014 +0000
Readd COLLECT_TIMESTAMPS in Main.load()
It looks like this was accidently deleted in
967f1a6a4290154977ab7c0cc2cbe0560d7246ce when we changed how we
parsed the bridge descriptors.
This was originally added in
11b83c612090d673d4f23ccaf85be66ec5588e8a.
---
lib/bridgedb/Main.py | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/lib/bridgedb/Main.py b/lib/bridgedb/Main.py
index 28d6c8f..adedfaf 100644
--- a/lib/bridgedb/Main.py
+++ b/lib/bridgedb/Main.py
@@ -124,17 +124,18 @@ def load(state, splitter, clear=False):
logging.info("Opening bridge-server-descriptor file: '%s'" % fname)
f = open(fname, 'r')
desc_digests.update(Bridges.getDescriptorDigests(f))
- for bridge in bridges.values():
- if bridge.getID() in timestamps.keys():
- ts = timestamps[bridge.getID()][:]
- ts.sort()
- for timestamp in ts:
- logging.debug(
- "Adding/updating timestamps in BridgeHistory for "\
- "'%s' in database: %s"
- % (bridge.fingerprint, timestamp))
- bridgedb.Stability.addOrUpdateBridgeHistory(
- bridge, timestamp)
+ if state.COLLECT_TIMESTAMPS:
+ for bridge in bridges.values():
+ if bridge.getID() in timestamps.keys():
+ ts = timestamps[bridge.getID()][:]
+ ts.sort()
+ for timestamp in ts:
+ logging.debug(
+ "Adding/updating timestamps in BridgeHistory for "\
+ "'%s' in database: %s"
+ % (bridge.fingerprint, timestamp))
+ bridgedb.Stability.addOrUpdateBridgeHistory(
+ bridge, timestamp)
logging.debug("Closing bridge-server-descriptor file: '%s'" % fname)
f.close()
More information about the tor-commits
mailing list