redis password
This commit is contained in:
parent
2b21b169be
commit
1285a770fc
@ -4,7 +4,13 @@ import redis
|
||||
|
||||
|
||||
def get_redis():
|
||||
return redis.Redis(host=os.getenv("REDIS_HOST", "127.0.0.1"))
|
||||
password = os.getenv("REDIS_PASSWORD", None)
|
||||
kwargs = {
|
||||
"host": os.getenv("REDIS_HOST", "127.0.0.1")
|
||||
}
|
||||
if password:
|
||||
kwargs['password'] = password
|
||||
return redis.Redis(**kwargs)
|
||||
|
||||
|
||||
def get(key):
|
||||
|
Loading…
Reference in New Issue
Block a user