This commit is contained in:
root
2026-05-18 06:48:30 +00:00
parent f1145e3a36
commit e638a4656c
14 changed files with 172 additions and 11 deletions

View File

@@ -88,6 +88,12 @@ process_backend = WebProcessBackend(BASE_DIR, DEFAULT_LOG_DIR)
raise_nofile_limit()
def _runtime_layout_warnings() -> list[str]:
from src.runtime_bootstrap import ensure_runtime_layout
return ensure_runtime_layout(BASE_DIR)
def _sanitize_pm2_dir_fragment(name: str) -> str:
s = re.sub(r"[^a-zA-Z0-9._-]+", "_", (name or "").strip())
return (s or "default")[:120]
@@ -496,6 +502,10 @@ def script_for_pm2(pm2: str) -> Optional[str]:
@asynccontextmanager
async def lifespan(app: FastAPI):
runtime_issues = _runtime_layout_warnings()
if runtime_issues:
for issue in runtime_issues:
print(f"[web] runtime-dir warning: {issue}", file=sys.stderr)
try:
await process_backend.ensure_mode()
except Exception: