Skip to content

Commit

Permalink
Make decode response an environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
danimar-nextroll committed Mar 12, 2020
1 parent e70e156 commit 08a2a01
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flanker/addresslib/drivers/redis_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ def __init__(self, host=None, port=None, prefix='mxr:', ttl=604800):
host = host or os.environ.get('REDIS_HOST', 'localhost')
port = port or os.environ.get('REDIS_PORT', 6379)
db = os.environ.get('REDIS_DB', 0)
self.r = redis.StrictRedis(host=host, port=port, db=db, decode_responses=True)
decode_resp = os.environ.get('REDIS_DECODE_RESPONSES', False)
self.r = redis.StrictRedis(host=host, port=port, db=db, decode_responses=decode_resp)

def __getitem__(self, key):
try:
Expand Down

0 comments on commit 08a2a01

Please sign in to comment.