Compare commits
No commits in common. "79e5151dd0cbac88fc40d31bcb563f2acb9e429f" and "e2f05dae0319579b45a01ea9ae605cc4e9bf2fed" have entirely different histories.
79e5151dd0
...
e2f05dae03
@ -4,6 +4,12 @@ import redis.asyncio as connection
|
|||||||
|
|
||||||
REDIS_HOST = os.getenv('REDIS_HOST', 'localhost')
|
REDIS_HOST = os.getenv('REDIS_HOST', 'localhost')
|
||||||
REDIS_PASSWORD = os.getenv('REDIS_PASSWORD')
|
REDIS_PASSWORD = os.getenv('REDIS_PASSWORD')
|
||||||
|
if REDIS_PASSWORD:
|
||||||
|
URL = f'redis://:{REDIS_PASSWORD}@{REDIS_HOST}:6379'
|
||||||
|
else:
|
||||||
|
URL = f'redis://{REDIS_HOST}:6379'
|
||||||
|
|
||||||
|
|
||||||
database = connection.Redis(host=REDIS_HOST, password=REDIS_PASSWORD)
|
|
||||||
|
pool = connection.from_url(URL)
|
||||||
|
database = connection.Redis.from_pool(pool)
|
||||||
|
Loading…
Reference in New Issue
Block a user