We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e842a9 commit ed3f6b6Copy full SHA for ed3f6b6
src/idom/server/_asgi.py
@@ -28,15 +28,15 @@ async def serve_development_asgi(
28
coros: list[Awaitable[Any]] = [server.serve()]
29
30
if started:
31
-
32
- async def check_if_started() -> None:
33
- while not server.started:
34
- await asyncio.sleep(0.2)
35
- started.set()
36
37
- coros.append(check_if_started())
+ coros.append(_check_if_started(server, started))
38
39
try:
40
await asyncio.gather(*coros)
41
finally:
42
await asyncio.wait_for(server.shutdown(), timeout=3)
+
+async def _check_if_started(server: UvicornServer, started: asyncio.Event) -> None:
+ while not server.started:
+ await asyncio.sleep(0.2)
+ started.set()
0 commit comments