This commit is contained in:
eric
2026-03-29 03:51:50 -05:00
parent 7cab3f27b8
commit 915412a819
6 changed files with 119 additions and 6 deletions

7
web.py
View File

@@ -30,6 +30,7 @@ from src.android_control import (
list_android_devices,
)
from src.scrcpy_stream import cleanup_scrcpy_session, open_scrcpy_h264_stream, scrcpy_stream_info
from src.scrcpy_vendor import ensure_scrcpy_jar
from src.control_plane import (
delete_root_file,
list_root_files,
@@ -341,6 +342,12 @@ async def lifespan(app: FastAPI):
except Exception:
# PM2/Shell 异常时不阻塞整站启动(否则反代持续 502
pass
try:
ok, msg = await asyncio.to_thread(ensure_scrcpy_jar, BASE_DIR)
if not ok:
print(f"[web] scrcpy-server: {msg}", file=sys.stderr)
except Exception as exc:
print(f"[web] scrcpy-server bootstrap: {exc}", file=sys.stderr)
yield