feat(sre): close provider and telegram automation receipts
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user