ЛР 2 — БВТ2303 — Брезгунова — на 5

This commit is contained in:
2026-10-22 13:28:45 +03:00
parent 65003b6119
commit 9ac1762101
31 changed files with 3387 additions and 37 deletions
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env python3
import argparse
import time
from urllib.request import urlopen
p = argparse.ArgumentParser()
p.add_argument('--base-url', default='http://localhost:8080')
args = p.parse_args()
deadline = time.monotonic()+90
while True:
try:
with urlopen(args.base_url+'/health/ready', timeout=3) as response:
if response.status == 200:
print('API ready')
break
except OSError:
pass
if time.monotonic() >= deadline:
raise SystemExit('API did not become ready in 90 seconds')
time.sleep(0.5)