From 4f73c47dcbb034d1a6dfe375472a0bb322c0fe39 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Wed, 16 Feb 2022 16:50:35 -0800 Subject: [PATCH] Use explicit reference to app object for server. I have no idea why the docs think strings are better. pyinstaller wasn't able to detect the import through the string so the code ended up being stripped from the package. Use an explicit import to prevent that. --- game/server/server.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/game/server/server.py b/game/server/server.py index bfc89483..34fcfe02 100644 --- a/game/server/server.py +++ b/game/server/server.py @@ -6,6 +6,7 @@ from threading import Thread import uvicorn from uvicorn import Config +from game.server.app import app from game.server.settings import ServerSettings @@ -13,7 +14,7 @@ class Server(uvicorn.Server): def __init__(self) -> None: super().__init__( Config( - "game.server.app:app", + app=app, host=ServerSettings.get().server_bind_address, port=ServerSettings.get().server_port, log_level="info",