[Bugfix] Guard app.state access during server shutdown (#2587)
Signed-off-by: pjh4993 <pjh4993@naver.com>
This commit is contained in:
1 parent
0edc356fc8
commit
ed7a448cd3
1 file changed
+3
-1
@@ -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()
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user