incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [11/50] git commit: [#4691] Expunge items from ming session when removing from ModelCache
Date Wed, 06 Feb 2013 15:42:52 GMT
[#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/db53e8c4
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/db53e8c4
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/db53e8c4

Branch: refs/heads/cj/4691
Commit: db53e8c4e5c92ee4237f407f3a6f1e9113dacdf6
Parents: f95b094
Author: Cory Johns <johnsca@geek.net>
Authored: Fri Dec 7 17:20:37 2012 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Tue Feb 5 20:22:50 2013 +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/db53e8c4/Allura/allura/model/repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo.py b/Allura/allura/model/repo.py
index 85e44ad..77b97d2 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