1
0
forked from bot/app

🐛 修复生命周期钩子函数的问题

This commit is contained in:
2024-08-08 18:06:03 +08:00
parent c29a3fd6d4
commit f69feb1def
27 changed files with 172 additions and 148 deletions

View File

@ -8,6 +8,8 @@ import threading
from pathlib import Path
from typing import Any, Callable, Coroutine
from liteyuki.log import logger
def is_coroutine_callable(call: Callable[..., Any]) -> bool:
"""
@ -55,7 +57,7 @@ def run_coroutine(*coro: Coroutine):
loop.close()
except Exception as e:
# 捕获其他异常,防止协程被重复等待
print(f"Exception occurred: {e}")
logger.error(f"Exception occurred: {e}")
def path_to_module_name(path: Path) -> str: