summaryrefslogtreecommitdiffstats
path: root/pym/portage/dbapi/vartree.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-05-26 19:14:20 -0700
committerZac Medico <zmedico@gentoo.org>2011-05-26 19:14:20 -0700
commitdb603c15e4e820b309d4cf5b99186e5a02a89318 (patch)
treed799a98ef8579122d3cf3d52685e5ffeae910fc9 /pym/portage/dbapi/vartree.py
parent0105b96356fc9af05af33e9ef4b2d0a662501cec (diff)
downloadportage-db603c15e4e820b309d4cf5b99186e5a02a89318.tar.gz
portage-db603c15e4e820b309d4cf5b99186e5a02a89318.tar.bz2
portage-db603c15e4e820b309d4cf5b99186e5a02a89318.zip
counter_tick_core: flush the cache (periodically)
Since we hold a lock, this is a good opportunity to flush the cache. Note that this will only flush the cache periodically in the main process when _aux_cache_threshold is exceeded.
Diffstat (limited to 'pym/portage/dbapi/vartree.py')
-rw-r--r--pym/portage/dbapi/vartree.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 982324c2c..e742358dc 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -837,6 +837,12 @@ class vardbapi(dbapi):
self.settings._init_dirs()
write_atomic(self._counter_path, str(counter))
self._cached_counter = counter
+
+ # Since we hold a lock, this is a good opportunity
+ # to flush the cache. Note that this will only
+ # flush the cache periodically in the main process
+ # when _aux_cache_threshold is exceeded.
+ self.flush_cache()
finally:
self.unlock()