feat(sre): close provider and telegram automation receipts

This commit is contained in:
ogt
2026-07-17 02:27:29 +08:00
parent 1b551e0d33
commit 6b82adca35
45 changed files with 8263 additions and 944 deletions

View File

@@ -10,10 +10,21 @@ import re
import sys
from pathlib import Path
def _bootstrap_api_import(repo_root: Path) -> Path:
candidates = (
repo_root / "apps" / "api", # source checkout
repo_root, # production API image: /app/src
)
for api_root in candidates:
if (api_root / "src").is_dir():
if str(api_root) not in sys.path:
sys.path.insert(0, str(api_root))
return api_root
raise RuntimeError("paid_provider_canary_api_source_root_not_found")
_REPO_ROOT = Path(__file__).resolve().parents[2]
_API_ROOT = _REPO_ROOT / "apps" / "api"
if str(_API_ROOT) not in sys.path:
sys.path.insert(0, str(_API_ROOT))
_API_ROOT = _bootstrap_api_import(_REPO_ROOT)
async def _init_runtime() -> None: