@@ -0,0 +1,31 @@
|
||||
"""
|
||||
WSGI entrypoint (gunicorn, uwsgi и т.д.).
|
||||
|
||||
Перед импортом приложения выставляет WESP_CONFIG=production, если не задано —
|
||||
чтобы конфиг совпал с ожидаемым для боевого деплоя (в т.ч. с Alembic).
|
||||
"""
|
||||
|
||||
import atexit
|
||||
import os
|
||||
|
||||
import wesp_runtime_env
|
||||
|
||||
wesp_runtime_env.apply_kiosk_headless_env()
|
||||
|
||||
os.environ.setdefault("WESP_CONFIG", "production")
|
||||
|
||||
from app import create_app
|
||||
from app.runtime_services import schedule_runtime_services
|
||||
|
||||
app = create_app()
|
||||
|
||||
if not app.config.get("TESTING"):
|
||||
from app.services.mdns_service import register_mdns_shutdown
|
||||
from app.services.startup_background import register_post_ready_callback
|
||||
|
||||
register_mdns_shutdown(app)
|
||||
|
||||
if app.config.get("WESP_DEFERRED_STARTUP"):
|
||||
register_post_ready_callback(schedule_runtime_services)
|
||||
else:
|
||||
schedule_runtime_services(app)
|
||||
Reference in New Issue
Block a user