Add grade hot cache

This commit is contained in:
咕谷酱
2025-08-21 23:35:25 +08:00
parent 7c193937d1
commit 822d7c6377
13 changed files with 973 additions and 47 deletions

View File

@@ -28,9 +28,11 @@ def json_serializer(value):
engine = create_async_engine(
settings.database_url,
json_serializer=json_serializer,
pool_size=20,
max_overflow=20,
pool_size=30, # 增加连接池大小
max_overflow=50, # 增加最大溢出连接数
pool_timeout=30.0,
pool_recycle=3600, # 1小时回收连接
pool_pre_ping=True, # 启用连接预检查
)
# Redis 连接