performance: db/aiohttp connection pooling

This commit is contained in:
2025-12-18 07:51:47 -05:00
parent bc8b407a91
commit 10ccf8c8eb
7 changed files with 350 additions and 44 deletions

View File

@@ -24,9 +24,7 @@ import aiohttp
from fastapi import FastAPI, Depends, HTTPException, Request
from fastapi_throttle import RateLimiter
from fastapi.responses import JSONResponse
import redis
from lyric_search.sources import private
from auth.deps import get_current_user
from dotenv import load_dotenv
@@ -72,10 +70,10 @@ class Lighting:
self.util = util
self.constants = constants
# Redis for state persistence
self.redis_client = redis.Redis(
password=private.REDIS_PW, decode_responses=True
)
# Redis for state persistence - use shared sync client
import shared
self.redis_client = shared.get_redis_sync_client(decode_responses=True)
self.lighting_key = "lighting:state"
# Cync configuration from environment