fix: use asyncio.run() in entrypoint for Python 3.12 compatibility
CI / lint-and-test (push) Has been cancelled

This commit is contained in:
2026-07-10 22:35:53 +02:00
parent 8151c530da
commit 4ea1f3c03a
+7 -9
View File
@@ -9,15 +9,13 @@ echo "[entrypoint] Waiting for database to be ready..."
# Wait for PostgreSQL to accept connections (max 30s retries) # Wait for PostgreSQL to accept connections (max 30s retries)
for i in $(seq 1 30); do for i in $(seq 1 30); do
if python -c "import asyncpg,os; asyncio.get_event_loop().run_until_complete( if python -c "import asyncpg,os,asyncio; asyncio.run(asyncpg.connect(
asyncpg.connect( host=os.getenv('POSTGRES_HOST','db'),
host=os.getenv('POSTGRES_HOST','db'), port=int(os.getenv('POSTGRES_PORT','5432')),
port=int(os.getenv('POSTGRES_PORT','5432')), user=os.getenv('POSTGRES_USER','postgres'),
user=os.getenv('POSTGRES_USER','postgres'), password=os.getenv('POSTGRES_PASSWORD'),
password=os.getenv('POSTGRES_PASSWORD'), database=os.getenv('POSTGRES_DB','postgres'),
database=os.getenv('POSTGRES_DB','postgres'), ))" 2>/dev/null; then
)
)" 2>/dev/null; then
echo "[entrypoint] Database is ready." echo "[entrypoint] Database is ready."
break break
fi fi