Skip to content

Commit ee76451

Browse files
committed
PYTHON-2453 Correctly add ServerApi to all w=0 writes
1 parent ab8b959 commit ee76451

File tree

2 files changed

+1
-1
lines changed

2 files changed

+1
-1
lines changed

pymongo/bulk.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@ def _execute_command(self, generator, write_concern, session,
296296
run.op_type, self.collection.codec_options)
297297

298298
while run.idx_offset < len(run.ops):
299-
sock_info.add_server_api(cmd, session)
300299
if session:
301300
# Start a new retryable write unless one was already
302301
# started for this command.

pymongo/message.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -893,6 +893,7 @@ def __init__(self, database_name, command, sock_info, operation_id,
893893
self.compress = True if sock_info.compression_context else False
894894
self.op_type = op_type
895895
self.codec = codec
896+
sock_info.add_server_api(command, session)
896897

897898
def _batch_command(self, docs):
898899
namespace = self.db_name + '.$cmd'

0 commit comments

Comments
 (0)