From: Zac Medico Date: Fri, 27 May 2011 02:14:20 +0000 (-0700) Subject: counter_tick_core: flush the cache (periodically) X-Git-Tag: v2.1.9.50~2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c71146ee4ae7c9c9c15a17de6bd8f3abf376d1d6;p=portage.git 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. --- 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()