Fix entrypoint

This commit is contained in:
Andrew Chen Wang 2023-06-28 09:19:56 -04:00 committed by GitHub
parent dda67d449b
commit 9a74e459e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,14 +20,14 @@ python << END
import sys
import time
import psycopg2
import psycopg
suggest_unrecoverable_after = 30
start = time.time()
while True:
try:
psycopg2.connect(
psycopg.connect(
dbname="${POSTGRES_DB}",
user="${POSTGRES_USER}",
password="${POSTGRES_PASSWORD}",
@ -35,7 +35,7 @@ while True:
port="${POSTGRES_PORT}",
)
break
except psycopg2.OperationalError as error:
except psycopg.OperationalError as error:
sys.stderr.write("Waiting for PostgreSQL to become available...\n")
if time.time() - start > suggest_unrecoverable_after: