From 4ea1f3c03a4b9ccece1cbcc5fc2a4d0887511bf2 Mon Sep 17 00:00:00 2001 From: Jose Lago Date: Fri, 10 Jul 2026 22:35:53 +0200 Subject: [PATCH] fix: use asyncio.run() in entrypoint for Python 3.12 compatibility --- worker/src/entrypoint.sh | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/worker/src/entrypoint.sh b/worker/src/entrypoint.sh index ccbdc46..bfbb2a9 100644 --- a/worker/src/entrypoint.sh +++ b/worker/src/entrypoint.sh @@ -9,15 +9,13 @@ echo "[entrypoint] Waiting for database to be ready..." # Wait for PostgreSQL to accept connections (max 30s retries) for i in $(seq 1 30); do - if python -c "import asyncpg,os; asyncio.get_event_loop().run_until_complete( - asyncpg.connect( - host=os.getenv('POSTGRES_HOST','db'), - port=int(os.getenv('POSTGRES_PORT','5432')), - user=os.getenv('POSTGRES_USER','postgres'), - password=os.getenv('POSTGRES_PASSWORD'), - database=os.getenv('POSTGRES_DB','postgres'), - ) - )" 2>/dev/null; then + if python -c "import asyncpg,os,asyncio; asyncio.run(asyncpg.connect( + host=os.getenv('POSTGRES_HOST','db'), + port=int(os.getenv('POSTGRES_PORT','5432')), + user=os.getenv('POSTGRES_USER','postgres'), + password=os.getenv('POSTGRES_PASSWORD'), + database=os.getenv('POSTGRES_DB','postgres'), + ))" 2>/dev/null; then echo "[entrypoint] Database is ready." break fi