incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject git commit: [#4691] Expunge items from ming session when removing from ModelCache
Date Fri, 07 Dec 2012 17:20:51 GMT
Updated Branches:
  refs/heads/cj/4691 a79b8d1b0 -> 6de80ffca


[#4691] Expunge items from ming session when removing from ModelCache

Signed-off-by: Cory Johns <johnsca@geek.net>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/6de80ffc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/6de80ffc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/6de80ffc

Branch: refs/heads/cj/4691
Commit: 6de80ffca7ad4d2ab5527556dd6d3fdf6d9a6c97
Parents: a79b8d1
Author: Cory Johns <johnsca@geek.net>
Authored: Fri Dec 7 17:20:37 2012 +0000
Committer: Cory Johns <johnsca@geek.net>
Committed: Fri Dec 7 17:20:37 2012 +0000

----------------------------------------------------------------------
 Allura/allura/model/repo.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6de80ffc/Allura/allura/model/repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo.py b/Allura/allura/model/repo.py
index 9e7eb44..aefc1fa 100644
--- a/Allura/allura/model/repo.py
+++ b/Allura/allura/model/repo.py
@@ -885,7 +885,8 @@ class ModelCache(object):
             self._cache[cls][key] = val
         elif len(self._cache[cls]) >= self.max_size:
             # remove the least-recently-used cache item
-            self._cache[cls].popitem(last=False)
+            instance = self._cache[cls].popitem(last=False)
+            session(instance).expunge(instance)
 
     def size(self):
         return sum([len(c) for c in self._cache.values()])


Mime
View raw message