mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-17 18:06:06 +00:00
fix: use --standalone-runtime
This commit is contained in:
@@ -19,8 +19,14 @@ asciiart = r"""
|
|||||||
async def main_entry(loop: asyncio.AbstractEventLoop):
|
async def main_entry(loop: asyncio.AbstractEventLoop):
|
||||||
parser = argparse.ArgumentParser(description='LangBot')
|
parser = argparse.ArgumentParser(description='LangBot')
|
||||||
parser.add_argument('--skip-plugin-deps-check', action='store_true', help='跳过插件依赖项检查', default=False)
|
parser.add_argument('--skip-plugin-deps-check', action='store_true', help='跳过插件依赖项检查', default=False)
|
||||||
|
parser.add_argument('--standalone-runtime', action='store_true', help='使用独立插件运行时', default=False)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
|
if args.standalone_runtime:
|
||||||
|
from pkg.utils import platform
|
||||||
|
|
||||||
|
platform.standalone_runtime = True
|
||||||
|
|
||||||
print(asciiart)
|
print(asciiart)
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|||||||
@@ -14,7 +14,9 @@ def get_platform() -> str:
|
|||||||
return sys.platform
|
return sys.platform
|
||||||
|
|
||||||
|
|
||||||
|
standalone_runtime = False
|
||||||
|
|
||||||
|
|
||||||
def use_websocket_to_connect_plugin_runtime() -> bool:
|
def use_websocket_to_connect_plugin_runtime() -> bool:
|
||||||
"""是否使用 websocket 连接插件运行时"""
|
"""是否使用 websocket 连接插件运行时"""
|
||||||
STANDALONE_RUNTIME = os.environ.get('STANDALONE_RUNTIME', 'false')
|
return standalone_runtime
|
||||||
return STANDALONE_RUNTIME == 'true'
|
|
||||||
|
|||||||
Reference in New Issue
Block a user