docs: 移动蓝绿部署指南到 troubleshooting 目录

This commit is contained in:
Simon
2026-07-05 17:03:36 +08:00
parent ab90db3d3d
commit ca7c6d937a
91 changed files with 4841 additions and 406 deletions
+7 -2
View File
@@ -40,6 +40,8 @@ class Settings(BaseSettings):
wecom_agent_id: str = "1000002"
# 应用Secret(在企微管理后台 > 应用管理 > 自建应用 中查看)
wecom_secret: str = "your-agent-secret"
# 审批应用Secret(在企微管理后台 > 应用管理 > 审批 > 查看Secret
wecom_approval_secret: str = ""
# 回调Token(在企微管理后台 > 应用管理 > 接收消息 中设置)
wecom_token: str = "your-callback-token"
# 回调EncodingAESKey43位字符串,用于消息加解密)
@@ -57,7 +59,8 @@ class Settings(BaseSettings):
# ----------------------------------------------------------------------
# Redis 连接地址
# Docker 环境使用容器名 redis,本地开发使用 localhost
redis_url: str = "redis://localhost:6379/0"
# 从环境变量 REDIS_URL 读取,格式: redis://:password@host:port/db
redis_url: str = "" # 默认为空,由环境变量 REDIS_URL 提供
# ----------------------------------------------------------------------
# 服务配置
@@ -192,7 +195,9 @@ class Settings(BaseSettings):
Returns:
aioredis.Redis: 配置好的 Redis 异步客户端
"""
return aioredis.from_url(self.redis_url, protocol=2)
# 如果 redis_url 为空,使用默认值
url = self.redis_url if self.redis_url else "redis://localhost:6379/0"
return aioredis.from_url(url, protocol=2)
# 创建全局配置实例