You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/02/06 16:42:52 UTC
[11/50] git commit: [#4691] Expunge items from ming session when
removing from ModelCache
[#4691] Expunge items from ming session when removing from ModelCache
Signed-off-by: Cory Johns <jo...@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 <jo...@geek.net>
Authored: Fri Dec 7 17:20:37 2012 +0000
Committer: Tim Van Steenburgh <tv...@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()])