17 lines
611 B
Batchfile
17 lines
611 B
Batchfile
@echo off
|
|
rem Authenticated multi-user gateway, restarted automatically if it stops.
|
|
rem Per-user engines write logs to web_sim_data\users\<id>\data\backend.log.
|
|
cd /d "%~dp0"
|
|
set PYTHONIOENCODING=utf-8
|
|
if not exist web_sim_data mkdir web_sim_data
|
|
:loop
|
|
echo [%date% %time%] gateway start >> web_sim_data\gateway.log
|
|
if exist ".venv\Scripts\python.exe" (
|
|
".venv\Scripts\python.exe" web_proxy.py >> web_sim_data\gateway.log 2>&1
|
|
) else (
|
|
py -3 web_proxy.py >> web_sim_data\gateway.log 2>&1
|
|
)
|
|
echo [%date% %time%] gateway stopped, restart in 5 s >> web_sim_data\gateway.log
|
|
timeout /t 5 /nobreak >nul
|
|
goto loop
|