feat: 优化服务器停止时的逻辑

This commit is contained in:
helloplhm-qwq 2023-12-17 13:37:42 +08:00
parent e999ebdf99
commit 9b5f48c915
No known key found for this signature in database
GPG Key ID: 6BE1B64B905567C7

10
main.py
View File

@ -145,5 +145,11 @@ async def initMain():
logger.info("Server stopped")
if __name__ == "__main__":
start_checkcn_thread()
asyncio.run(initMain())
try:
start_checkcn_thread()
asyncio.run(initMain())
except KeyboardInterrupt:
pass
except:
logger.error('初始化出错,请检查日志')
logger.error(traceback.format_exc())