MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / set_conn_timeout

Method set_conn_timeout

pymongo/asynchronous/pool.py:184–189  ·  view source on GitHub ↗

Cache last timeout to avoid duplicate calls to conn.settimeout.

(self, timeout: Optional[float])

Source from the content-addressed store, hash-verified

182 self._cluster_time = None
183
184 def set_conn_timeout(self, timeout: Optional[float]) -> None:
185 """Cache last timeout to avoid duplicate calls to conn.settimeout."""
186 if timeout == self.last_timeout:
187 return
188 self.last_timeout = timeout
189 self.conn.get_conn.settimeout(timeout)
190
191 def apply_timeout(
192 self, client: AsyncMongoClient[Any], cmd: Optional[MutableMapping[str, Any]]

Callers 2

apply_timeoutMethod · 0.95
_helloMethod · 0.95

Calls 1

settimeoutMethod · 0.45

Tested by

no test coverage detected