aboutsummaryrefslogtreecommitdiff
path: root/chat/chat_cache.py
diff options
context:
space:
mode:
Diffstat (limited to 'chat/chat_cache.py')
-rw-r--r--chat/chat_cache.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/chat/chat_cache.py b/chat/chat_cache.py
index 43354ef7..8c107a6c 100644
--- a/chat/chat_cache.py
+++ b/chat/chat_cache.py
@@ -2,7 +2,17 @@ import json
import redis
-r = redis.Redis(host='localhost', port=6379, db=0)
+import os
+from dotenv import load_dotenv
+
+load_dotenv()
+
+r = redis.Redis(
+ host=os.getenv('REDIS_HOST'),
+ port=os.getenv('REDIS_PORT'),
+ password=os.getenv('REDIS_PASSWORD'),
+ db=0
+)
def handle_connect():
# increase number of connected users