You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by tv...@apache.org on 2013/02/05 21:23:35 UTC

[5/42] git commit: [#4691] Don't expunge None

[#4691] Don't expunge None


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

Branch: refs/heads/master
Commit: 604e978640dd4c5201af80941727e453398bb821
Parents: 2f32ed1
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Mon Dec 10 15:12:27 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/604e9786/Allura/allura/model/repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo.py b/Allura/allura/model/repo.py
index c89be56..bd6acfc 100644
--- a/Allura/allura/model/repo.py
+++ b/Allura/allura/model/repo.py
@@ -886,7 +886,8 @@ class ModelCache(object):
         elif len(self._cache[cls]) >= self.max_size:
             # remove the least-recently-used cache item
             key, instance = self._cache[cls].popitem(last=False)
-            session(instance).expunge(instance)
+            if instance and session(instance):
+                session(instance).expunge(instance)
 
     def size(self):
         return sum([len(c) for c in self._cache.values()])