summaryrefslogtreecommitdiff
path: root/client/src/leap/soledad
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/leap/soledad')
-rw-r--r--client/src/leap/soledad/client/api.py3
-rw-r--r--client/src/leap/soledad/client/sqlcipher.py1
-rw-r--r--client/src/leap/soledad/client/sync.py3
3 files changed, 6 insertions, 1 deletions
diff --git a/client/src/leap/soledad/client/api.py b/client/src/leap/soledad/client/api.py
index 1be3adac..5ba93721 100644
--- a/client/src/leap/soledad/client/api.py
+++ b/client/src/leap/soledad/client/api.py
@@ -301,7 +301,8 @@ class Soledad(object):
if getattr(self, '_dbsyncer', None):
self._dbsyncer.close()
# close the sync database
- self._sync_db.close()
+ if self._sync_db:
+ self._sync_db.close()
self._sync_db = None
if self._defer_encryption:
self._sync_enc_pool.stop()
diff --git a/client/src/leap/soledad/client/sqlcipher.py b/client/src/leap/soledad/client/sqlcipher.py
index 34fd90b4..a76a35b7 100644
--- a/client/src/leap/soledad/client/sqlcipher.py
+++ b/client/src/leap/soledad/client/sqlcipher.py
@@ -633,6 +633,7 @@ class SQLCipherU1DBSync(SQLCipherDatabase):
"""
# close all open syncers
for url in self._syncers.keys():
+ self._syncers[url][1].close()
del self._syncers[url]
diff --git a/client/src/leap/soledad/client/sync.py b/client/src/leap/soledad/client/sync.py
index 77abd868..1a881555 100644
--- a/client/src/leap/soledad/client/sync.py
+++ b/client/src/leap/soledad/client/sync.py
@@ -184,6 +184,9 @@ class SoledadSynchronizer(Synchronizer):
# if gapless record current reached generation with target
return self._record_sync_info_with_the_target(info["my_gen"])
+ def close(self):
+ self.sync_target.close()
+
def _record_sync_info_with_the_target(self, start_generation):
"""
Store local replica metadata in server.