MCPcopy
hub / github.com/psycopg/psycopg / _maybe_grow_pool

Method _maybe_grow_pool

psycopg_pool/psycopg_pool/pool.py:309–317  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

307 raise
308
309 def _maybe_grow_pool(self) -> None:
310 # Allow only one task at time to grow the pool (or returning
311 # connections might be starved).
312 if self._nconns >= self._max_size or self._growing:
313 return
314 self._nconns += 1
315 logger.info("growing pool %r to %s", self.name, self._nconns)
316 self._growing = True
317 self.run_task(AddConnection(self, growing=True))
318
319 def putconn(self, conn: CT) -> None:
320 """Return a connection to the loving hands of its pool.

Callers 2

_getconn_uncheckedMethod · 0.95
checkMethod · 0.95

Calls 3

run_taskMethod · 0.95
AddConnectionClass · 0.70
infoMethod · 0.45

Tested by

no test coverage detected