Add env() config binding with teleport() for CLI-to-worker config passing

This commit is contained in:
2026-09-17 02:54:08 +00:00
parent 69a1ba3239
commit 1d4a0a5422
6 changed files with 257 additions and 10 deletions
+3 -1
View File
@@ -15,7 +15,7 @@ from uvicorn import Config, Server
from uvicorn.main import STARTUP_FAILURE
from uvicorn.supervisors import ChangeReload, Multiprocess
from .environ import env
from .environ import env, teleport
from .hostutil import parse_endpoints
from .logging import (
install_access_log,
@@ -148,6 +148,8 @@ def run( # noqa: PLR0913
msg = "No endpoints to serve; check listen configuration"
raise ValueError(msg)
teleport() # Serialize bound objects before spawning workers
if startup_box:
print_startup_box(startup_box, app, endpoints)