mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-15 17:30:13 +08:00
fix: use sys.stdin.isatty() for non-interactive detection
Replace redundant ASTRBOT_SYSTEMD environment variable checks with sys.stdin.isatty() for detecting non-interactive environments. The DashboardManager.ensure_installed() already handles this internally, so the outer ASTRBOT_SYSTEMD checks were unnecessary.
This commit is contained in:
@@ -138,11 +138,7 @@ async def initialize_astrbot(
|
||||
default=True,
|
||||
)
|
||||
):
|
||||
# 避免在 systemd 模式下因等待输入而阻塞
|
||||
if os.environ.get("ASTRBOT_SYSTEMD") == "1":
|
||||
click.echo("Systemd detected: Skipping dashboard check.")
|
||||
else:
|
||||
await DashboardManager().ensure_installed(astrbot_root)
|
||||
await DashboardManager().ensure_installed(astrbot_root)
|
||||
else:
|
||||
click.echo("你可以使用在线面版(需支持配置后端)来控制。")
|
||||
|
||||
|
||||
@@ -93,9 +93,7 @@ async def run_astrbot(astrbot_root: Path) -> None:
|
||||
os.environ.get("ASTRBOT_DASHBOARD_ENABLE", os.environ.get("DASHBOARD_ENABLE"))
|
||||
== "True"
|
||||
):
|
||||
# Avoid blocking when running under systemd by waiting for input
|
||||
if os.environ.get("ASTRBOT_SYSTEMD") != "1":
|
||||
await DashboardManager().ensure_installed(astrbot_root)
|
||||
await DashboardManager().ensure_installed(astrbot_root)
|
||||
|
||||
log_broker = LogBroker()
|
||||
LogManager.set_queue_handler(logger, log_broker)
|
||||
|
||||
Reference in New Issue
Block a user