[tor-commits] [stem/master] Drop cache values for set_options() params instead of setting cache

atagar at torproject.org atagar at torproject.org
Mon May 21 01:44:25 UTC 2018


commit 1eb527579d83ac6d2bc5c15eceeaabe0fa5f927b
Author: Dave Rolek <dmr-x at riseup.net>
Date:   Tue May 15 18:57:20 2018 +0000

    Drop cache values for set_options() params instead of setting cache
    
    Partially fixes #25821, which should now fully be implemented
---
 stem/control.py | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/stem/control.py b/stem/control.py
index c67de63c..1bef73b9 100644
--- a/stem/control.py
+++ b/stem/control.py
@@ -2432,16 +2432,8 @@ class Controller(BaseController):
       log.debug('%s (runtime: %0.4f)' % (query, time.time() - start_time))
 
       if self.is_caching_enabled():
-        to_cache = {}
-
-        for param, value in params:
-          param = param.lower()
-
-          if stem.util._is_str(value):
-            value = [value]
-
-          to_cache[param] = value
-
+        # clear cache for params; the CONF_CHANGED event will set cache for changes
+        to_cache = dict((k.lower(), None) for k, v in params)
         self._set_cache(to_cache, 'getconf')
         self._confchanged_cache_invalidation(dict(params))
     else:





More information about the tor-commits mailing list