c = self.pgconn.get_cancel()
c.cancel()
except Exception as ex:
- logger.warning("couldn't try to cancel query: %s", str(ex))
+ logger.warning("couldn't try to cancel query: %s", ex)
def _should_cancel(self) -> bool:
"""Check whether the current command should actually be cancelled when
try:
attempts.extend(_resolve_hostnames(attempt))
except OSError as ex:
- logger.debug("failed to resolve host %r: %s", attempt.get("host"), str(ex))
+ logger.debug("failed to resolve host %r: %s", attempt.get("host"), ex)
last_exc = ex
if not attempts:
try:
attempts.extend(await _resolve_hostnames(attempt))
except OSError as ex:
- logger.debug("failed to resolve host %r: %s", attempt.get("host"), str(ex))
+ logger.debug("failed to resolve host %r: %s", attempt.get("host"), ex)
last_exc = ex
if not attempts:
try:
waiting.wait_conn(self._cancel_gen(), interval=_WAIT_INTERVAL)
except Exception as ex:
- logger.warning("couldn't try to cancel query: %s", str(ex))
+ logger.warning("couldn't try to cancel query: %s", ex)
else:
self.cancel()
self._cancel_gen(), interval=_WAIT_INTERVAL
)
except Exception as ex:
- logger.warning("couldn't try to cancel query: %s", str(ex))
+ logger.warning("couldn't try to cancel query: %s", ex)
else:
if True: # ASYNC