P1-7(部分): 3个潜伏bug修复 - main.py app_root未定义/scheduler.py AsyncIOSScheduler拼写/config.py logger未定义
This commit is contained in:
@@ -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"],
|
||||
|
||||
Reference in New Issue
Block a user