Files
mtusi2026lab2/scripts/restart.bat

15 lines
297 B
Batchfile

@echo off
cd /d %~dp0\..
docker compose restart api postgres
set /a count=0
:check_loop
timeout /t 2 /nobreak >nul
curl -s -f http://localhost:8080/health/ready >nul 2>&1
if %errorlevel% equ 0 exit /b 0
set /a count+=1
if %count% lss 15 goto check_loop
echo API failed to become ready
exit /b 1