server: refactor with clearer pipeline instanciation and linked to model

This commit is contained in:
2023-10-26 19:00:56 +02:00
committed by Mathieu Virbel
parent 433c0500cc
commit 1c42473da0
8 changed files with 658 additions and 616 deletions

View File

@@ -14,6 +14,7 @@ import json
import redis.asyncio as redis
from fastapi import WebSocket
from reflector.settings import settings
ws_manager = None
@@ -114,7 +115,8 @@ def get_ws_manager() -> WebsocketManager:
RedisConnectionError: If there is an error connecting to the Redis server.
"""
global ws_manager
from reflector.settings import settings
if ws_manager:
return ws_manager
pubsub_client = RedisPubSubManager(
host=settings.REDIS_HOST,