collect db values for integrity check in chunks

This commit is contained in:
Jack Robison 2022-11-12 16:48:01 -05:00
parent 134aad29f1
commit 929448d64b

View file

@ -135,8 +135,10 @@ class RevertableOpStack:
existing = {} existing = {}
if self._enforce_integrity and unique_keys: if self._enforce_integrity and unique_keys:
unique_keys = list(unique_keys) unique_keys = list(unique_keys)
for idx in range(0, len(unique_keys), 10000):
batch = unique_keys[idx:idx+10000]
existing.update({ existing.update({
k: v for k, v in zip(unique_keys, self._multi_get(unique_keys)) k: v for k, v in zip(batch, self._multi_get(batch))
}) })
for op in ops_to_apply: for op in ops_to_apply: