mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-26 03:24:01 +03:00
Fix entrypoint
This commit is contained in:
parent
dda67d449b
commit
9a74e459e4
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user