Skip to content

Commit

Permalink
fix(bot): 热重载错误 (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
st1020 committed Aug 15, 2023
1 parent 633c072 commit 5ff9db4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions alicebot/bot.py
Expand Up @@ -187,6 +187,9 @@ def restart(self) -> None:

async def _run(self) -> None:
"""运行 AliceBot。"""
self.should_exit = asyncio.Event()
self._condition = asyncio.Condition()

# 监听并拦截系统退出信号,从而完成一些善后工作后再关闭程序
if threading.current_thread() is threading.main_thread():
# Signal 仅能在主线程中被处理。
Expand Down

0 comments on commit 5ff9db4

Please sign in to comment.