summaryrefslogtreecommitdiff
path: root/client/src/leap
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2016-11-16 22:03:02 -0300
committerdrebs <drebs@leap.se>2016-12-12 09:12:01 -0200
commit3ec2aea071bdc1a76f90761adf9c0e38fa4cb832 (patch)
tree3be8df7f8d4107ddcbed9d041ec87c72ed314875 /client/src/leap
parentb9ef460f39a9f0b62894367c4260986e35fbbb1c (diff)
[style] improve comments for sync.py
Diffstat (limited to 'client/src/leap')
-rw-r--r--client/src/leap/soledad/client/sync.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/client/src/leap/soledad/client/sync.py b/client/src/leap/soledad/client/sync.py
index 272b3f57..6bd58f8f 100644
--- a/client/src/leap/soledad/client/sync.py
+++ b/client/src/leap/soledad/client/sync.py
@@ -141,18 +141,7 @@ class SoledadSynchronizer(Synchronizer):
self.sync_phase[0] += 1
# --------------------------------------------------------------------
- # prepare to send all the changed docs
- # changed_doc_ids = [doc_id for doc_id, _, _ in changes]
- # docs_to_send = self.source.get_docs(
- # changed_doc_ids, check_for_conflicts=False, include_deleted=True)
ids_sent = [doc_id for doc_id, _, _ in changes]
- # docs_by_generation = []
- # idx = 0
- # for doc in docs_to_send:
- # _, gen, trans = changes[idx]
- # docs_by_generation.append((doc, gen, trans))
- # idx += 1
- # ids_sent.append(doc.doc_id)
docs_by_generation = []
for doc_id, gen, trans in changes:
get_doc = (self.source.get_doc, doc_id)
@@ -166,8 +155,8 @@ class SoledadSynchronizer(Synchronizer):
self._insert_doc_from_target, ensure_callback=ensure_callback)
logger.debug("target gen after sync: %d" % new_gen)
logger.debug("target trans_id after sync: %s" % new_trans_id)
- if hasattr(self.source, 'commit'):
- self.source.commit() # sync worked, commit
+ if hasattr(self.source, 'commit'): # sqlcipher backend speed up
+ self.source.commit() # insert it all in a single transaction
info = {
"target_replica_uid": self.target_replica_uid,
"new_gen": new_gen,