summaryrefslogtreecommitdiffstats
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:16:06 -0700
commitc71146ee4ae7c9c9c15a17de6bd8f3abf376d1d6 (patch)
treee6b97f916e36a3c1409c7d364506bac009fc2433
parent4762f2f388727d30d4d0b1ba3d2eb3da94d83871 (diff)
downloadportage-c71146ee4ae7c9c9c15a17de6bd8f3abf376d1d6.tar.gz
portage-c71146ee4ae7c9c9c15a17de6bd8f3abf376d1d6.tar.bz2
portage-c71146ee4ae7c9c9c15a17de6bd8f3abf376d1d6.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.
-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 0ff2f7d6f..f93652b37 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -798,6 +798,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()