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/01/10 19:08:21 UTC

[35/50] 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/41c1d50c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/41c1d50c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/41c1d50c

Branch: refs/heads/cj/4691
Commit: 41c1d50c67d220f553abbf55909c4e2f9e012c5d
Parents: 0bba128
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Mon Dec 10 15:12:27 2012 +0000
Committer: Cory Johns <jo...@geek.net>
Committed: Thu Jan 10 16:27:18 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/41c1d50c/Allura/allura/model/repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo.py b/Allura/allura/model/repo.py
index b9aaad0..cbb5145 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()])