# (which might or might not have been already transferred entirely to
# the client, so we won't necessary see the exception associated with
# canceling).
- self.connection._try_cancel(timeout=5.0)
+ self.connection._try_cancel()
self.connection.wait(self._end_copy_out_gen())
# (which might or might not have been already transferred entirely to
# the client, so we won't necessary see the exception associated with
# canceling).
- await self.connection._try_cancel(timeout=5.0)
+ await self.connection._try_cancel()
await self.connection.wait(self._end_copy_out_gen())
else:
self.cancel()
- def _try_cancel(self, *, timeout: float = 30.0) -> None:
+ def _try_cancel(self, *, timeout: float = 5.0) -> None:
try:
self.cancel_safe(timeout=timeout)
except Exception as ex:
else:
self.cancel()
- async def _try_cancel(self, *, timeout: float = 30.0) -> None:
+ async def _try_cancel(self, *, timeout: float = 5.0) -> None:
try:
await self.cancel_safe(timeout=timeout)
except Exception as ex:
if self._pgconn.transaction_status == ACTIVE:
# Try to cancel the query, then consume the results
# already received.
- self._conn._try_cancel(timeout=5.0)
+ self._conn._try_cancel()
try:
while self._conn.wait(self._stream_fetchone_gen(first=False)):
pass
if self._pgconn.transaction_status == ACTIVE:
# Try to cancel the query, then consume the results
# already received.
- await self._conn._try_cancel(timeout=5.0)
+ await self._conn._try_cancel()
try:
while await self._conn.wait(
self._stream_fetchone_gen(first=False)