Skip to content

Commit

Permalink
fix: test case
Browse files Browse the repository at this point in the history
  • Loading branch information
xianml committed Nov 26, 2024
1 parent 152da33 commit 05b1ec2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions uvicorn/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,9 @@ async def _wait_tasks_to_complete(self) -> None:
while self.server_state.tasks and not self.force_exit:
await asyncio.sleep(0.1)

for server in self.servers:
await server.wait_closed()
if hasattr(self, "servers") and self.servers:
for server in self.servers:
await server.wait_closed()

@contextlib.contextmanager
def capture_signals(self) -> Generator[None, None, None]:
Expand Down

0 comments on commit 05b1ec2

Please sign in to comment.