|
|
@@ -14,6 +14,11 @@ class Settings(BaseSettings):
|
|
|
|
|
|
# 数据库配置
|
|
|
DATABASE_URL: str = "mysql+pymysql://root:password@localhost:3306/sanqiang"
|
|
|
+ # SQLAlchemy 连接池(生产 WORKERS=1 建议 pool_size=10、max_overflow=20)
|
|
|
+ DB_POOL_SIZE: int = 5
|
|
|
+ DB_MAX_OVERFLOW: int = 10
|
|
|
+ DB_POOL_TIMEOUT: int = 30
|
|
|
+ DB_POOL_RECYCLE: int = 3600
|
|
|
|
|
|
# JWT配置
|
|
|
SECRET_KEY: str = "your-secret-key-change-in-production-please-use-random-string"
|
|
|
@@ -123,6 +128,8 @@ class Settings(BaseSettings):
|
|
|
API_ENCRYPT_FIXED_SECRET: str = ""
|
|
|
API_ENCRYPT_TS_SKEW_SEC: int = 300
|
|
|
API_ENCRYPT_NONCE_TTL_SEC: int = 300
|
|
|
+ # nonce 写入 Redis 的操作超时(秒);过短易在并发/首连时误报 redis unavailable
|
|
|
+ API_ENCRYPT_REDIS_OP_TIMEOUT_SEC: float = 5.0
|
|
|
API_ENCRYPT_EXCLUDE_PATHS: str = (
|
|
|
"/,"
|
|
|
"/health,"
|