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

Method _run

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

Source from the content-addressed store, hash-verified

396 self._startup_time = time.monotonic()
397
398 async def _run(self) -> None:
399 # Don't poll right after creation, wait 60 seconds first
400 if time.monotonic() < self._startup_time + common.MIN_SRV_RESCAN_INTERVAL:
401 return
402 seedlist = await self._get_seedlist()
403 if seedlist:
404 self._seedlist = seedlist
405 try:
406 await self._topology.on_srv_update(self._seedlist)
407 except ReferenceError:
408 # Topology was garbage-collected.
409 await self.close()
410
411 async def _get_seedlist(self) -> Optional[list[tuple[str, Any]]]:
412 """Poll SRV records for a seedlist.

Callers

nothing calls this directly

Calls 3

_get_seedlistMethod · 0.95
on_srv_updateMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected