We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f170ec5 commit b58dfd2Copy full SHA for b58dfd2
1 file changed
postgresql/cluster.py
@@ -539,14 +539,14 @@ def ready_for_connections(self):
539
return False
540
e = None
541
host, port = self.address()
542
+ connection = self.driver.fit(
543
+ user = ' -*- ping -*- ',
544
+ host = host, port = port,
545
+ database = 'template1',
546
+ sslmode = 'disable',
547
+ )()
548
try:
- self.driver.connect(
- user = ' -*- ping -*- ',
- host = host or 'localhost',
- port = port or 5432,
- database = 'template1',
- sslmode = 'disable',
549
- ).close()
+ connection.connect()
550
except pg_exc.ClientCannotConnectError as err:
551
for attempt in err.database.failures:
552
x = attempt.error
0 commit comments