perf: plugin runtime connection robustness (#1698)

* debug: print detailed make connection failure error

* perf: active heartbeat to plugin runtime

* feat: add `--debug` arg
This commit is contained in:
Junyan Qin (Chin)
2025-09-30 21:07:15 +08:00
committed by GitHub
parent ed869f7e81
commit 74c3a77ed1
2 changed files with 38 additions and 3 deletions

13
main.py
View File

@@ -18,7 +18,13 @@ asciiart = r"""
async def main_entry(loop: asyncio.AbstractEventLoop):
parser = argparse.ArgumentParser(description='LangBot')
parser.add_argument('--standalone-runtime', action='store_true', help='使用独立插件运行时', default=False)
parser.add_argument(
'--standalone-runtime',
action='store_true',
help='Use standalone plugin runtime / 使用独立插件运行时',
default=False,
)
parser.add_argument('--debug', action='store_true', help='Debug mode / 调试模式', default=False)
args = parser.parse_args()
if args.standalone_runtime:
@@ -26,6 +32,11 @@ async def main_entry(loop: asyncio.AbstractEventLoop):
platform.standalone_runtime = True
if args.debug:
from pkg.utils import constants
constants.debug_mode = True
print(asciiart)
import sys