Do not serialize the data in bulk_data

This can lead to multiple serializations when retrying with backoff
helper
This commit is contained in:
Honza Král
2017-07-18 16:15:08 -04:00
parent accb19ab90
commit 957fcad34b
+2 -2
View File
@@ -55,7 +55,7 @@ def _chunk_actions(actions, chunk_size, max_chunk_bytes, serializer):
bulk_actions, bulk_data = [], []
size, action_count = 0, 0
for action, data in actions:
raw_action = action
raw_data, raw_action = action
action = serializer.dumps(action)
cur_size = len(action) + 1
@@ -72,7 +72,7 @@ def _chunk_actions(actions, chunk_size, max_chunk_bytes, serializer):
bulk_actions.append(action)
if data is not None:
bulk_actions.append(data)
bulk_data.append((raw_action, data))
bulk_data.append((raw_action, raw_data))
else:
bulk_data.append((raw_action, ))