summaryrefslogtreecommitdiff
path: root/client/src
diff options
context:
space:
mode:
authorVictor Shyba <victor.shyba@gmail.com>2016-08-20 00:44:02 -0300
committerVictor Shyba <victor.shyba@gmail.com>2016-08-22 12:36:16 -0300
commit062d781b734db60d0ae317eaf5b86c7d75abacd9 (patch)
treeced2625544ea00ae64847fbdb0ad60f74e39b844 /client/src
parentb75165567539dcd59873395049ce2210776aa166 (diff)
[bug] limit pool comnsumption to 900 docs
This was discovered during load tests: Trying to process more than 999 docs triggers an error on SQLite due a select query not supporting 999 values to query.
Diffstat (limited to 'client/src')
-rw-r--r--client/src/leap/soledad/client/encdecpool.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/client/src/leap/soledad/client/encdecpool.py b/client/src/leap/soledad/client/encdecpool.py
index 2cf5da6e..7be6030e 100644
--- a/client/src/leap/soledad/client/encdecpool.py
+++ b/client/src/leap/soledad/client/encdecpool.py
@@ -556,6 +556,8 @@ class SyncDecrypterPool(SyncEncryptDecryptPool):
while next_index in self._decrypted_docs_indexes:
sequence.append(str(next_index))
next_index += 1
+ if len(sequence) > 900:
+ break # SQLITE_LIMIT_VARIABLE_NUMBER
# Then fetch all the ones ready for insertion.
if sequence:
insertable_docs = yield self._get_docs(encrypted=False,