Skip to content

Commit

Permalink
redis added
Browse files Browse the repository at this point in the history
  • Loading branch information
crushr3sist committed May 15, 2024
1 parent 13fd27a commit a845c8d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions r3almX_backend/realtime_service/connection_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

class Connection:
def __init__(self):
self.redis_client = redis.Redis()
self.redis_client = redis.Redis().from_url(
url="redis://172.22.96.1:6379", decode_responses=True, db=0
)
self.connection_status_cache: Dict[str, str] = {}
self.connection_sockets: Dict[str, WebSocket] = {}

Expand Down Expand Up @@ -61,7 +63,7 @@ def set_status(self, user_id, status):
getattr(self, f"set_{status}")(user_id)

def set_status_cache(self, user_id, status):
self.redis_client.hset("user_status", user_id, status)
self.redis_client.hset("user_status", str(user_id), status)


connection_manager = Connection()
Expand Down

0 comments on commit a845c8d

Please sign in to comment.