s
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user