collect db values for integrity check in chunks
This commit is contained in:
parent
134aad29f1
commit
929448d64b
1 changed files with 5 additions and 3 deletions
|
@ -135,9 +135,11 @@ class RevertableOpStack:
|
|||
existing = {}
|
||||
if self._enforce_integrity and unique_keys:
|
||||
unique_keys = list(unique_keys)
|
||||
existing.update({
|
||||
k: v for k, v in zip(unique_keys, self._multi_get(unique_keys))
|
||||
})
|
||||
for idx in range(0, len(unique_keys), 10000):
|
||||
batch = unique_keys[idx:idx+10000]
|
||||
existing.update({
|
||||
k: v for k, v in zip(batch, self._multi_get(batch))
|
||||
})
|
||||
|
||||
for op in ops_to_apply:
|
||||
if op.key in self._items and len(self._items[op.key]) and self._items[op.key][-1] == op.invert():
|
||||
|
|
Loading…
Reference in a new issue