feat: port lab3 backend foundation to lab4

This commit is contained in:
sinveria
2026-11-09 19:17:48 +03:00
parent ec540a1a72
commit aaa834e412
42 changed files with 2787 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/env python3
import sys
import time
import urllib.request
url = sys.argv[1] if len(sys.argv) > 1 else 'http://localhost:8080/health/ready'
timeout = int(sys.argv[2]) if len(sys.argv) > 2 else 30
deadline = time.monotonic() + timeout
while time.monotonic() < deadline:
try:
with urllib.request.urlopen(url, timeout=2) as response:
if response.status == 200:
raise SystemExit(0)
except Exception:
time.sleep(0.5)
raise SystemExit('Readiness timeout: ' + url)