Skip to content

Commit 96a2893

Browse files
authored
fix: Fix object has no attribute servers (#87)
1 parent e4f920a commit 96a2893

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

singlestoredb/apps/_python_udfs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ async def run_udf_app(
6262
port=app_config.listen_port,
6363
log_level=log_level,
6464
)
65-
_running_server = AwaitableUvicornServer(config)
6665

6766
# Register the functions only if the app is running interactively.
6867
if app_config.running_interactively:
6968
app.register_functions(replace=True)
7069

70+
_running_server = AwaitableUvicornServer(config)
7171
asyncio.create_task(_running_server.serve())
7272
await _running_server.wait_for_startup()
7373

singlestoredb/apps/_stdout_supress.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class StdoutSuppressor:
99
This should not be used for asynchronous or threaded executions.
1010
1111
```py
12-
with Supressor():
12+
with StdoutSupressor():
1313
print("This won't be printed")
1414
```
1515

singlestoredb/apps/_uvicorn_util.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ async def startup(self, sockets: Optional[List[socket.socket]] = None) -> None:
3030

3131
async def wait_for_startup(self) -> None:
3232
await self._startup_future
33+
34+
async def shutdown(self, sockets: Optional[list[socket.socket]] = None) -> None:
35+
if self.started:
36+
await super().shutdown(sockets)

0 commit comments

Comments
 (0)