MCPcopy Create free account
hub / github.com/MagicStack/asyncpg / _check_conn_validity

Method _check_conn_validity

asyncpg/connresource.py:32–44  ·  view source on GitHub ↗
(self, meth_name)

Source from the content-addressed store, hash-verified

30 self._con_release_ctr = connection._pool_release_ctr
31
32 def _check_conn_validity(self, meth_name):
33 con_release_ctr = self._connection._pool_release_ctr
34 if con_release_ctr != self._con_release_ctr:
35 raise exceptions.InterfaceError(
36 'cannot call {}.{}(): '
37 'the underlying connection has been released back '
38 'to the pool'.format(self.__class__.__name__, meth_name))
39
40 if self._connection.is_closed():
41 raise exceptions.InterfaceError(
42 'cannot call {}.{}(): '
43 'the underlying connection is closed'.format(
44 self.__class__.__name__, meth_name))

Callers 1

_checkFunction · 0.45

Calls 1

is_closedMethod · 0.80

Tested by

no test coverage detected