forked from mtusi2026/mtusi2026lab2
Lab2 grade 4: PostgreSQL, Redis sessions, Compose, student tests and evidence.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
@echo off
|
||||
setlocal
|
||||
cd /d "%~dp0\.."
|
||||
docker compose --env-file .env restart postgres redis api
|
||||
if errorlevel 1 exit /b 1
|
||||
set /a i=0
|
||||
:wait
|
||||
docker compose --env-file .env exec -T api python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/health/ready', timeout=2)" >nul 2>&1
|
||||
if not errorlevel 1 exit /b 0
|
||||
set /a i+=1
|
||||
if %i% geq 60 (
|
||||
echo restart: API not ready within 60s >&2
|
||||
exit /b 1
|
||||
)
|
||||
timeout /t 1 /nobreak >nul
|
||||
goto wait
|
||||
Reference in New Issue
Block a user