[or-cvs] r18178: {weather} Tread the failures gdbm as we treat all other gdbm files. (weather/trunk)

ioerror at seul.org ioerror at seul.org
Mon Jan 19 08:50:34 UTC 2009


Author: ioerror
Date: 2009-01-19 03:50:34 -0500 (Mon, 19 Jan 2009)
New Revision: 18178

Modified:
   weather/trunk/poll.py
   weather/trunk/weather.py
Log:
Tread the failures gdbm as we treat all other gdbm files.


Modified: weather/trunk/poll.py
===================================================================
--- weather/trunk/poll.py	2009-01-19 06:28:44 UTC (rev 18177)
+++ weather/trunk/poll.py	2009-01-19 08:50:34 UTC (rev 18178)
@@ -124,11 +124,11 @@
 class WeatherPoller(threading.Thread):
   "This thread sits around, checking to see if tor nodes are up."
 
-  def __init__(self, subscriptions, lock):
+  def __init__(self, subscriptions, failures, lock):
     #self.subscriptions = gdbm.open(weather_storage + "/subscriptions")
     self.gdbm_lock = lock
     self.subscriptions = subscriptions
-    self.failure_counts = gdbm.open(weather_storage + "/failures.gdbm", "cs") 
+    self.failure_counts = failures
     self.failure_counts.reorganize() # just in case
     if debug:
       print "failure counts"

Modified: weather/trunk/weather.py
===================================================================
--- weather/trunk/weather.py	2009-01-19 06:28:44 UTC (rev 18177)
+++ weather/trunk/weather.py	2009-01-19 08:50:34 UTC (rev 18178)
@@ -52,6 +52,11 @@
       for s in unsubscriptions.keys():
         print s, unsubscriptions[s]
 
+      failures = gdbm.open(weather_storage + "/failures.gdbm", "cs")
+      print "failures:"
+      for s in failures.keys():
+        print s, failures[s]
+
       antispam_lock = threading.RLock()
       antispam = {}      # a dict mapping IP to the number of recent unanswered requests allowed
                          # from that IP
@@ -372,7 +377,7 @@
 
 def main():
   from poll import WeatherPoller
-  weather_reports = WeatherPoller(subscriptions, gdbm_lock)
+  weather_reports = WeatherPoller(subscriptions, failures, gdbm_lock)
   weather_reports.start()                 # this starts another thread
 
   relaxant = AntispamRelaxer()



More information about the tor-commits mailing list