Apply the given write concern to a command.
(
cmd: MutableMapping[str, Any], write_concern: Optional[WriteConcern]
)
| 128 | |
| 129 | |
| 130 | def apply_write_concern( |
| 131 | cmd: MutableMapping[str, Any], write_concern: Optional[WriteConcern] |
| 132 | ) -> None: |
| 133 | """Apply the given write concern to a command.""" |
| 134 | if not write_concern or write_concern.is_server_default: |
| 135 | return |
| 136 | wc = write_concern.document |
| 137 | if get_timeout() is not None: |
| 138 | wc.pop("wtimeout", None) |
| 139 | if wc: |
| 140 | cmd["writeConcern"] = wc |
| 141 | |
| 142 | |
| 143 | _MAX_RTT_SAMPLES: int = 10 |
nothing calls this directly
no test coverage detected