performance: db/aiohttp connection pooling
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user