summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-03-21 22:29:38 -0300
committerdrebs <drebs@leap.se>2017-04-04 18:27:37 +0200
commit3676894387fe0ac243ee252cecaa61e96fd275a8 (patch)
treee58b78206f050f59e0dfe10ad711b1568063716a
parent1bdfb12b98c6db2b54014b207fe05f235a0ae4bb (diff)
[feature] adds a close method for local blobs store
-rw-r--r--client/src/leap/soledad/client/_blobs.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/client/src/leap/soledad/client/_blobs.py b/client/src/leap/soledad/client/_blobs.py
index a8d9e139..2c613a80 100644
--- a/client/src/leap/soledad/client/_blobs.py
+++ b/client/src/leap/soledad/client/_blobs.py
@@ -160,6 +160,10 @@ class BlobManager(object):
self.user = user
self._client = HTTPClient(user, token, cert_file)
+ def close(self):
+ if hasattr(self, 'local') and self.local:
+ return self.local.close()
+
@defer.inlineCallbacks
def put(self, doc):
fd = doc.blob_fd
@@ -255,6 +259,9 @@ class SQLiteBlobBackend(object):
backend, self.path, check_same_thread=False, timeout=5,
cp_openfun=openfun, cp_min=1, cp_max=2, cp_name='blob_pool')
+ def close(self):
+ return self.dbpool.close()
+
@defer.inlineCallbacks
def put(self, blob_id, blob_fd, size=None):
logger.info("Saving blob in local database...")