feat(phase5): 解耦与收尾清理
- core/redis_client.py 移除 scheduler 耦合,lifespan 由 core/app.py 组合(Redis→调度器→Redis) - main.py 改从 core.app 导入 create_app - 删除 apps/、extensions/ 目录;utils 删除已迁移垫片与死代码 formatter.py - 新增 deploy/(nginx、supervisor)、scripts/(init_db、seed)、logs/(结构化日志落盘) - core/app.py 接入 core.logger setup_logging - 更新 CLAUDE.md 反映 core/shared/modules 新结构 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -56,14 +56,7 @@ async def redis_lifespan(app: FastAPI):
|
||||
print(f"Redis 连接成功 --> {REDIS_HOST}:{REDIS_PORT}/{REDIS_INDEX}")
|
||||
logger.info(f"Redis 连接成功: {REDIS_HOST}:{REDIS_PORT}/{REDIS_INDEX}")
|
||||
|
||||
# startup: 初始化定时任务调度器
|
||||
from modules.job.scheduler import init_scheduler, shutdown_scheduler
|
||||
job_count = init_scheduler()
|
||||
logger.info(f"定时任务调度器已启动,加载 {job_count} 个任务")
|
||||
|
||||
yield
|
||||
# shutdown: 关闭调度器
|
||||
shutdown_scheduler()
|
||||
|
||||
# shutdown: 关闭连接
|
||||
await redis.aclose()
|
||||
|
||||
Reference in New Issue
Block a user