Harden Windows service supervision

This commit is contained in:
2026-09-07 11:19:45 +08:00
parent 266f29853e
commit 44ce5e655d
9 changed files with 199 additions and 9 deletions
+5 -1
View File
@@ -5,9 +5,11 @@ cd /d "%~dp0"
set "LOG_DIR=%~dp0logs"
set "LOG_FILE=%LOG_DIR%\autostart.log"
set "DOCUTRANSLATE_NONINTERACTIVE=1"
if not exist "%LOG_DIR%" mkdir "%LOG_DIR%"
:restart
echo.>> "%LOG_FILE%"
echo [%DATE% %TIME%] Starting DocuTranslate autostart runner...>> "%LOG_FILE%"
@@ -15,5 +17,7 @@ call "%~dp0run.bat" >> "%LOG_FILE%" 2>&1
set "EXIT_CODE=%ERRORLEVEL%"
echo [%DATE% %TIME%] DocuTranslate stopped with exit code %EXIT_CODE%.>> "%LOG_FILE%"
echo [%DATE% %TIME%] Restarting in 10 seconds...>> "%LOG_FILE%"
exit /b %EXIT_CODE%
timeout /t 10 /nobreak >nul
goto restart