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

Method _run

pymongo/asynchronous/monitor.py:480–491  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

478 self._moving_min.reset()
479
480 async def _run(self) -> None:
481 try:
482 # NOTE: This thread is only run when using the streaming
483 # heartbeat protocol (MongoDB 4.4+).
484 # XXX: Skip check if the server is unknown?
485 rtt = await self._ping()
486 await self.add_sample(rtt)
487 except ReferenceError:
488 # Topology was garbage-collected.
489 await self.close()
490 except Exception:
491 await self._pool.reset()
492
493 async def _ping(self) -> float:
494 """Run a "hello" command and return the RTT."""

Callers

nothing calls this directly

Calls 4

_pingMethod · 0.95
add_sampleMethod · 0.95
closeMethod · 0.95
resetMethod · 0.45

Tested by

no test coverage detected