diff --git a/singlestoredb/apps/_python_udfs.py b/singlestoredb/apps/_python_udfs.py index d7bca6d6b..c58d1a220 100644 --- a/singlestoredb/apps/_python_udfs.py +++ b/singlestoredb/apps/_python_udfs.py @@ -52,12 +52,12 @@ async def run_udf_app( port=app_config.listen_port, log_level=log_level, ) - _running_server = AwaitableUvicornServer(config) # Register the functions only if the app is running interactively. if app_config.running_interactively: app.register_functions(replace=True) + _running_server = AwaitableUvicornServer(config) asyncio.create_task(_running_server.serve()) await _running_server.wait_for_startup() diff --git a/singlestoredb/apps/_stdout_supress.py b/singlestoredb/apps/_stdout_supress.py index 8d9b30043..775050c02 100644 --- a/singlestoredb/apps/_stdout_supress.py +++ b/singlestoredb/apps/_stdout_supress.py @@ -9,7 +9,7 @@ class StdoutSuppressor: This should not be used for asynchronous or threaded executions. ```py - with Supressor(): + with StdoutSupressor(): print("This won't be printed") ``` diff --git a/singlestoredb/apps/_uvicorn_util.py b/singlestoredb/apps/_uvicorn_util.py index 7f5c43325..9131e7ea6 100644 --- a/singlestoredb/apps/_uvicorn_util.py +++ b/singlestoredb/apps/_uvicorn_util.py @@ -30,3 +30,7 @@ async def startup(self, sockets: Optional[List[socket.socket]] = None) -> None: async def wait_for_startup(self) -> None: await self._startup_future + + async def shutdown(self, sockets: Optional[list[socket.socket]] = None) -> None: + if self.started: + await super().shutdown(sockets)