[BugFix] make sure socket close (#15875)
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
This commit is contained in:
parent
7acd539cd7
commit
93491aefc7
@ -1098,9 +1098,10 @@ async def run_server(args, **uvicorn_kwargs) -> None:
|
|||||||
)
|
)
|
||||||
|
|
||||||
# NB: Await server shutdown only after the backend context is exited
|
# NB: Await server shutdown only after the backend context is exited
|
||||||
await shutdown_task
|
try:
|
||||||
|
await shutdown_task
|
||||||
sock.close()
|
finally:
|
||||||
|
sock.close()
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user