MCPcopy
hub / github.com/psycopg/psycopg / __del__

Method __del__

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

Source from the content-addressed store, hash-verified

116 self._open()
117
118 def __del__(self) -> None:
119 # If the '_closed' property is not set we probably failed in __init__.
120 # Don't try anything complicated as probably it won't work.
121 if getattr(self, "_closed", True):
122 return
123
124 workers = self._signal_stop_worker()
125 hint = "you can try to call 'close()' explicitly or to use the pool as context manager"
126 gather(*workers, timeout=5.0, timeout_hint=hint)
127
128 def _check_open_getconn(self) -> None:
129 super()._check_open_getconn()

Callers

nothing calls this directly

Calls 2

_signal_stop_workerMethod · 0.95
gatherFunction · 0.70

Tested by

no test coverage detected