summaryrefslogtreecommitdiff
path: root/obnamlib/fmt_ga/client.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2016-07-02 18:00:16 +0000
committerLars Wirzenius <liw@liw.fi>2016-07-02 18:00:16 +0000
commitd8039d3432118597555a249d22e5f75b6808792a (patch)
treeb67347c7faa09719ac2ee936d4920952e4b4cfec /obnamlib/fmt_ga/client.py
parent586900a585cb7924349a4011e0268752305bcf2b (diff)
downloadobnam-d8039d3432118597555a249d22e5f75b6808792a.tar.gz
Drop r/o caches while forgetting to reduce memory use
Diffstat (limited to 'obnamlib/fmt_ga/client.py')
-rw-r--r--obnamlib/fmt_ga/client.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/obnamlib/fmt_ga/client.py b/obnamlib/fmt_ga/client.py
index 85417d04..f60afb59 100644
--- a/obnamlib/fmt_ga/client.py
+++ b/obnamlib/fmt_ga/client.py
@@ -77,6 +77,12 @@ class GAClient(object):
def flush(self):
self._save_file_metadata()
+ def flush_ro(self):
+ for gen in self._generations:
+ metadata = gen.get_file_metadata()
+ metadata.flush_ro()
+ gen.set_root_object_id(metadata.get_root_object_id())
+
def commit(self):
self._load_data()
self._finish_current_generation_if_any()
@@ -509,6 +515,9 @@ class GAFileMetadata(object):
assert len(self._added_files) == 0
self._tree.flush()
+ def flush_ro(self):
+ self._tree.flush_ro()
+
def __iter__(self):
for filename in self._added_files:
yield filename