Skip to content

Commit

Permalink
fix(qq_api): πŸ› fix server not completely exit
Browse files Browse the repository at this point in the history
sleep 0.1 second at unload to wait bot listener server exit completely
  • Loading branch information
AnzhiZhang committed Feb 3, 2023
1 parent 90ef1cc commit e836fe8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions qq_api/qq_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import re
import time
import logging
from threading import Thread

Expand Down Expand Up @@ -94,6 +95,7 @@ async def on_meta_event(event: Event):
def on_unload(server: PluginServerInterface):
__mcdr_server.logger.info("Exiting bot listener server.")
__uvicorn_server.should_exit = True
time.sleep(0.1)


def get_bot() -> CQHttp:
Expand Down

0 comments on commit e836fe8

Please sign in to comment.