From 35cba8a8876cf536220812546cf17819e15c687d Mon Sep 17 00:00:00 2001 From: shum Date: Fri, 29 Aug 2025 06:34:17 +0000 Subject: [PATCH] apps/simplex-llm-bot: graceful shutdown --- apps/simplex-llm-bot/bot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/simplex-llm-bot/bot.py b/apps/simplex-llm-bot/bot.py index fa09b962bd..b33b350378 100644 --- a/apps/simplex-llm-bot/bot.py +++ b/apps/simplex-llm-bot/bot.py @@ -6,6 +6,7 @@ from collections import defaultdict import traceback import os import time +import logging chat_histories = defaultdict(list) @@ -146,4 +147,7 @@ if __name__ == "__main__": await live_msg.finish_live() # Start the bot - asyncio.run(bot.start()) + try: + asyncio.run(bot.start()) + except KeyboardInterrupt: + logging.info("Exiting")