Skip to content

Commit

Permalink
fix cache client reference
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Levinger committed Aug 24, 2022
1 parent 1a274de commit d3249bb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion call_server/political_data/countries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def cache_search(self, key_starts_with):
elif isinstance(self._cache.cache, flask_caching.backends.simple.SimpleCache) \
or isinstance(self._cache.cache, dict):
# naively search across all the keys
for (k,v) in self._cache.cache._cache.items():
for (k,v) in self._cache.cache.items():
if k.startswith(key_starts_with):
wet_value = pickle.loads(v[1])
if isinstance(wet_value, list):
Expand Down
2 changes: 1 addition & 1 deletion call_server/political_data/countries/us.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ def load_data(self):

# if cache is redis, add lexigraphical index on states, names
if hasattr(self._cache, 'cache') and isinstance(self._cache.cache, flask_caching.backends.rediscache.RedisCache):
redis = self._cache.cache._client
redis = self._cache.cache._write_client
searchable_items = legislators.items() + governors.items()
for (key,record) in searchable_items:
for sorted_key in self.SORTED_SETS:
Expand Down

0 comments on commit d3249bb

Please sign in to comment.