[Bugfix] Guard app.state access during server shutdown (#2587)

Signed-off-by: pjh4993 <pjh4993@naver.com>
This commit is contained in:
pjh4993 authored and GitHub committed 2026-04-09 14:41:23 +08:00
1 parent 0edc356fc8
commit ed7a448cd3
1 file changed
+3 -1
+3 -1
View File
@@ -353,7 +353,9 @@ async def omni_run_server_worker(listen_address, sock, args, client_config=None,
try:
await shutdown_task
finally:
app.state.openai_serving_speech.shutdown()
serving_speech = getattr(getattr(app, "state", None), "openai_serving_speech", None)
if serving_speech is not None:
serving_speech.shutdown()
sock.close()