allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject git commit: [#4691] Don't expunge None
Date Mon, 10 Dec 2012 15:13:02 GMT
Updated Branches:
  refs/heads/cj/4691 92c1958fd -> 9cb9a1121


[#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/9cb9a112
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/9cb9a112
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/9cb9a112

Branch: refs/heads/cj/4691
Commit: 9cb9a1121248c40d84ed9b9271b12cc4e393d214
Parents: 92c1958
Author: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Authored: Mon Dec 10 15:12:27 2012 +0000
Committer: Tim Van Steenburgh <tvansteenburgh@gmail.com>
Committed: Mon Dec 10 15:12:27 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/9cb9a112/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()])


Mime
View raw message