P1-7(部分): 3个潜伏bug修复 - main.py app_root未定义/scheduler.py AsyncIOSScheduler拼写/config.py logger未定义

This commit is contained in:
Simon
2026-07-18 01:13:33 +08:00
parent 873f3176e8
commit 2a4db59f02
3 changed files with 11 additions and 1 deletions
+4
View File
@@ -1014,6 +1014,10 @@ def create_app() -> FastAPI:
返回服务版本信息。
"""
import subprocess
from pathlib import Path
# v4.0 P1-7 修复:app_root 之前未定义导致 git_hash 永远 "unknown"
# 项目根 = app/main.py 的上两级(容器内为 /app)
app_root = Path(__file__).resolve().parents[1]
try:
git_hash = subprocess.check_output(
["git", "rev-parse", "HEAD"],