aboutsummaryrefslogtreecommitdiff
path: root/chat
diff options
context:
space:
mode:
authorBobby <[email protected]>2023-11-10 23:49:33 -0500
committerBobby <[email protected]>2023-11-10 23:49:33 -0500
commit9f5c83865ebcca3293d8f30dea6ea6fa8ed5abc2 (patch)
treea61e00f74fd8b6222f7c34e29bd25f7243e33a72 /chat
parenta79e6040f7d79c658374ceab26f90bd9f1d9ea59 (diff)
downloadthatcomputerscientist-9f5c83865ebcca3293d8f30dea6ea6fa8ed5abc2.tar.xz
thatcomputerscientist-9f5c83865ebcca3293d8f30dea6ea6fa8ed5abc2.zip
Moved to Redis Cloud
Diffstat (limited to 'chat')
-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