diff options
author | Victor Shyba <victor.shyba@gmail.com> | 2016-08-20 00:44:02 -0300 |
---|---|---|
committer | Victor Shyba <victor.shyba@gmail.com> | 2016-08-22 12:36:16 -0300 |
commit | 062d781b734db60d0ae317eaf5b86c7d75abacd9 (patch) | |
tree | ced2625544ea00ae64847fbdb0ad60f74e39b844 /client/src | |
parent | b75165567539dcd59873395049ce2210776aa166 (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.py | 2 |
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, |