forked from mtusi2026/mtusi2026lab5
15 lines
452 B
Python
15 lines
452 B
Python
"""Operator-facing readiness wait after container replacement."""
|
|
import time
|
|
import urllib.request
|
|
for _ in range(120):
|
|
try:
|
|
with urllib.request.urlopen("http://localhost:8080/health/ready", timeout=2) as response:
|
|
if response.status == 200:
|
|
print("[restart] all services ready")
|
|
break
|
|
except Exception:
|
|
pass
|
|
time.sleep(.5)
|
|
else:
|
|
raise SystemExit("[restart] health timeout")
|