[tor-commits] [stem/master] Logging a warning when the geoip db is unavailable

atagar at torproject.org atagar at torproject.org
Thu Dec 13 16:42:22 UTC 2012


commit 872af06dc1a5770fb57e0af72e2412aa879f7e1f
Author: Damian Johnson <atagar at torproject.org>
Date:   Tue Dec 11 19:30:45 2012 -0800

    Logging a warning when the geoip db is unavailable
    
    Issuing a warning when we've made enough failed geoip queries to conclude that
    the database is unavailable. This is partly for parity with arm which issues a
    warning in this situation (and that seems appropriate for other callers too).
---
 stem/control.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/stem/control.py b/stem/control.py
index 4b41e1c..d538a65 100644
--- a/stem/control.py
+++ b/stem/control.py
@@ -820,6 +820,9 @@ class Controller(BaseController):
       
       if is_geoip_request and self.is_caching_enabled() and self._geoip_failure_count != -1:
         self._geoip_failure_count += 1
+        
+        if self.is_geoip_unavailable():
+          log.warn("Tor's geoip database is unavailable.")
       
       log.debug("GETINFO %s (failed: %s)" % (" ".join(params), exc))
       





More information about the tor-commits mailing list