feat(core): 新增仅调试服务器运行模式

This commit is contained in:
XcantloadX 2025-02-04 15:34:48 +08:00
parent 714dafc124
commit 0364169f6e
2 changed files with 14 additions and 1 deletions

10
.vscode/launch.json vendored
View File

@ -49,6 +49,14 @@
"-t",
"kotonebot.tasks.common.BaseConfig"
]
}
},
{
"name": "KotonebotDebug: Run Debug Server",
"type": "debugpy",
"request": "launch",
"console": "integratedTerminal",
"module": "kotonebot.backend.debug.server",
"args": []
},
]
}

View File

@ -136,3 +136,8 @@ def wait_message_all_done():
if thread is not None:
threading.Thread(target=_wait, daemon=True).start()
if __name__ == "__main__":
from kotonebot.backend.context import init_context
init_context()
vars.debug.hide_server_log = False
uvicorn.run(app, host="127.0.0.1", port=8000, log_level='critical' if vars.debug.hide_server_log else None)