's'
This commit is contained in:
7
web.py
7
web.py
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user