去掉redis

启动时只检查数据库连接不更新表结构
This commit is contained in:
mark.tian
2025-12-04 08:35:33 +08:00
parent 6ac998ebdf
commit 7aeb84df37
7 changed files with 19 additions and 45 deletions

View File

@@ -5,12 +5,6 @@ class Settings(BaseSettings):
# 数据库配置
database_url: str = ""
# Redis配置
redis_url: str = "redis://localhost:6379/0"
redis_lock_timeout: int = 30 # 锁超时时间(秒)
redis_lock_retry_delay: float = 0.1 # 锁重试延迟(秒)
redis_lock_max_retries: int = 100 # 最大重试次数
# 业务配置
count_threshold: int = 3 # count阈值,大于等于此值直接返回
external_api_enabled: bool = False # 是否启用外部API调用

View File

@@ -106,5 +106,4 @@ def get_logger(name: Optional[str] = None) -> logging.Logger:
app_logger = get_logger("app")
api_logger = get_logger("api")
db_logger = get_logger("database")
redis_logger = get_logger("redis")
external_api_logger = get_logger("external_api")

View File

@@ -167,15 +167,6 @@ async def ai_talk_callback(
AI Talk回调接口处理
"""
try:
# 参数校验
if not callback_data:
logger.error("❌ callback_data 参数为空")
raise HTTPException(status_code=400, detail="callback_data 参数不能为空")
if not isinstance(callback_data.get('data'), list):
logger.error(f"❌ data 参数类型无效: {type(callback_data.get('data'))}")
raise HTTPException(status_code=400, detail="data 参数必须是数组")
# 记录回调请求(包含siteId)
success, callback_log_id = await log_callback_request(db, request, siteId, callback_data)