File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 88
99
1010def database_status ():
11+ import psycopg
12+
1113 try :
12- psycopg2 .connect (
14+ with psycopg .connect (
1315 dbname = os .environ ["DB_NAME" ],
1416 user = os .environ ["DB_USER" ],
1517 password = os .environ ["DB_PASS" ],
@@ -19,8 +21,9 @@ def database_status():
1921 sslcert = os .environ ["DB_SSLCERT" ],
2022 sslkey = os .environ ["DB_SSLKEY" ],
2123 sslrootcert = os .environ ["DB_SSLROOTCERT" ],
22- )
23- except psycopg2 .OperationalError :
24+ ):
25+ pass
26+ except psycopg .OperationalError :
2427 time .sleep (3 )
2528 return False
2629 else :
@@ -74,8 +77,6 @@ def redis_status():
7477 arguments = sys .argv [1 :]
7578 # Database Connection
7679 if "database" in arguments :
77- import psycopg2
78-
7980 print ("Waiting for database to become available..." )
8081 connected = False
8182 while not connected :
Original file line number Diff line number Diff line change 11channels_redis
22service_identity
33django-redis
4- psycopg2
4+ # pool is useful in prod deployments we include it
5+ # by default, but has to be configured manually
6+ psycopg [binary,pool ]< 4.0.0
57sentry-sdk
68supervisor >= 4.3.0 ,< 4.4.0
79django-cors-headers >= 4.9.0 ,< 4.10.0
You can’t perform that action at this time.
0 commit comments