mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-07-16 11:02:22 +03:00
Fix entrypoint
This commit is contained in:
parent
dda67d449b
commit
9a74e459e4
|
@ -20,14 +20,14 @@ python << END
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import psycopg2
|
import psycopg
|
||||||
|
|
||||||
suggest_unrecoverable_after = 30
|
suggest_unrecoverable_after = 30
|
||||||
start = time.time()
|
start = time.time()
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
psycopg2.connect(
|
psycopg.connect(
|
||||||
dbname="${POSTGRES_DB}",
|
dbname="${POSTGRES_DB}",
|
||||||
user="${POSTGRES_USER}",
|
user="${POSTGRES_USER}",
|
||||||
password="${POSTGRES_PASSWORD}",
|
password="${POSTGRES_PASSWORD}",
|
||||||
|
@ -35,7 +35,7 @@ while True:
|
||||||
port="${POSTGRES_PORT}",
|
port="${POSTGRES_PORT}",
|
||||||
)
|
)
|
||||||
break
|
break
|
||||||
except psycopg2.OperationalError as error:
|
except psycopg.OperationalError as error:
|
||||||
sys.stderr.write("Waiting for PostgreSQL to become available...\n")
|
sys.stderr.write("Waiting for PostgreSQL to become available...\n")
|
||||||
|
|
||||||
if time.time() - start > suggest_unrecoverable_after:
|
if time.time() - start > suggest_unrecoverable_after:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user