Выполнение 4 лабораторной на оценку 3

This commit is contained in:
2026-10-31 17:50:41 +03:00
parent ec540a1a72
commit ad63cf53bd
36 changed files with 1600 additions and 44 deletions
+18
View File
@@ -0,0 +1,18 @@
#!/bin/sh
set -eu
python - <<'PY'
import os, time
from sqlalchemy import create_engine, text
url = os.environ["DATABASE_URL"]
engine = create_engine(url, connect_args={"connect_timeout": 3})
for attempt in range(60):
try:
with engine.connect() as connection:
connection.execute(text("SELECT 1"))
break
except Exception:
if attempt == 59:
raise
time.sleep(1)
PY
exec "$@"