← back to Exo
ignore CancelledError when stopping the server
2e1233357c56b1ad7ac128e49eaa06715a0f5283 · 2024-08-21 19:30:53 +0100 · Alex Cheema
Files touched
Diff
commit 2e1233357c56b1ad7ac128e49eaa06715a0f5283
Author: Alex Cheema <alexcheema123@gmail.com>
Date: Wed Aug 21 19:30:53 2024 +0100
ignore CancelledError when stopping the server
---
main.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/main.py b/main.py
index ad969a9a..d6e0dee7 100644
--- a/main.py
+++ b/main.py
@@ -120,7 +120,10 @@ async def shutdown(signal, loop):
[task.cancel() for task in server_tasks]
print(f"Cancelling {len(server_tasks)} outstanding tasks")
await asyncio.gather(*server_tasks, return_exceptions=True)
- await server.stop()
+ try:
+ await server.stop()
+ except CancelledError:
+ pass
loop.stop()
async def run_model_cli(node: Node, inference_engine: InferenceEngine, model_name: str, prompt: str):
← ae35ada1 fix headless mode with --disable-tui
·
back to Exo
·
only ignore CancelledError inside stop dd24e7db →