"""
deadline = monotonic() + timeout if timeout else 0.0
+ # To debug slowdown during connection:
+ #
+ # $ PSYCOPG_IMPL=python python
+ # >>> import logging
+ # >>> logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(message)s')
+
conn = pq.PGconn.connect_start(conninfo.encode())
+ logger.debug("connection started: %s", conn)
while True:
if conn.status == BAD:
encoding = conninfo_encoding(conninfo)
)
status = conn.connect_poll()
+ logger.debug("connection polled: %s", conn)
if status == POLL_READING or status == POLL_WRITING:
wait = WAIT_R if status == POLL_READING else WAIT_W