1 |
commit: db603c15e4e820b309d4cf5b99186e5a02a89318 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri May 27 02:14:20 2011 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri May 27 02:14:20 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=db603c15 |
7 |
|
8 |
counter_tick_core: flush the cache (periodically) |
9 |
|
10 |
Since we hold a lock, this is a good opportunity to flush the cache. |
11 |
Note that this will only flush the cache periodically in the main |
12 |
process when _aux_cache_threshold is exceeded. |
13 |
|
14 |
--- |
15 |
pym/portage/dbapi/vartree.py | 6 ++++++ |
16 |
1 files changed, 6 insertions(+), 0 deletions(-) |
17 |
|
18 |
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py |
19 |
index 982324c..e742358 100644 |
20 |
--- a/pym/portage/dbapi/vartree.py |
21 |
+++ b/pym/portage/dbapi/vartree.py |
22 |
@@ -837,6 +837,12 @@ class vardbapi(dbapi): |
23 |
self.settings._init_dirs() |
24 |
write_atomic(self._counter_path, str(counter)) |
25 |
self._cached_counter = counter |
26 |
+ |
27 |
+ # Since we hold a lock, this is a good opportunity |
28 |
+ # to flush the cache. Note that this will only |
29 |
+ # flush the cache periodically in the main process |
30 |
+ # when _aux_cache_threshold is exceeded. |
31 |
+ self.flush_cache() |
32 |
finally: |
33 |
self.unlock() |