MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / pin

Method pin

pymongo/synchronous/client_session.py:449–454  ·  view source on GitHub ↗
(self, server: Server, conn: Connection)

Source from the content-addressed store, hash-verified

447 return None
448
449 def pin(self, server: Server, conn: Connection) -> None:
450 self.sharded = True
451 self.pinned_address = server.description.address
452 if server.description.server_type == SERVER_TYPE.LoadBalancer:
453 conn.pin_txn()
454 self.conn_mgr = _ConnectionManager(conn, False)
455
456 def unpin(self) -> None:
457 self.pinned_address = None

Callers 1

_pinMethod · 0.45

Calls 2

_ConnectionManagerClass · 0.90
pin_txnMethod · 0.45

Tested by

no test coverage detected