summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2015-07-19 15:58:09 +0300
committerLars Wirzenius <liw@liw.fi>2015-07-19 15:58:09 +0300
commitcc00d3ab4f5a96bab844f52896a04fea1cd8df52 (patch)
tree2f27126f932ed51bd41addb41bbb5e7f6b3d687b
parentc4e738ea9a38d4c45193b753e0cb5516b0e84597 (diff)
downloadobnam-cc00d3ab4f5a96bab844f52896a04fea1cd8df52.tar.gz
Only use one blob store per client
-rw-r--r--obnamlib/fmt_ga/client.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/obnamlib/fmt_ga/client.py b/obnamlib/fmt_ga/client.py
index 442564a1..65422855 100644
--- a/obnamlib/fmt_ga/client.py
+++ b/obnamlib/fmt_ga/client.py
@@ -45,6 +45,7 @@ class GAClient(object):
return self._dirname
def clear(self):
+ self._blob_store = None
self._client_keys = GAKeys()
self._generations = GAGenerationList()
self._data_is_loaded = False
@@ -72,14 +73,16 @@ class GAClient(object):
gen.set_root_object_id(metadata.get_root_object_id())
def _get_blob_store(self):
- bag_store = obnamlib.BagStore()
- bag_store.set_location(self._fs, self._dirname)
-
- blob_store = obnamlib.BlobStore()
- blob_store.set_bag_store(bag_store)
- blob_store.set_max_bag_size(obnamlib.DEFAULT_NODE_SIZE)
- blob_store.set_max_cache_bytes(obnamlib.DEFAULT_DIR_OBJECT_CACHE_BYTES)
- return blob_store
+ if self._blob_store is None:
+ bag_store = obnamlib.BagStore()
+ bag_store.set_location(self._fs, self._dirname)
+
+ self._blob_store = obnamlib.BlobStore()
+ self._blob_store.set_bag_store(bag_store)
+ self._blob_store.set_max_bag_size(obnamlib.DEFAULT_NODE_SIZE)
+ self._blob_store.set_max_cache_bytes(
+ obnamlib.DEFAULT_DIR_OBJECT_CACHE_BYTES)
+ return self._blob_store
def _save_per_client_data(self):
data = {