don't fail when trying to update relation cache for relation deletion, this may occurs regularly stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 01 Sep 2009 17:25:00 +0200
branchstable
changeset 3074 141cfaac6b97
parent 3073 09c6fe0db381
child 3077 6c92323667a6
don't fail when trying to update relation cache for relation deletion, this may occurs regularly
server/session.py
--- a/server/session.py	Tue Sep 01 11:02:31 2009 +0200
+++ b/server/session.py	Tue Sep 01 17:25:00 2009 +0200
@@ -129,8 +129,11 @@
                 if row[0] == targeteid:
                     break
             else:
-                raise Exception('cache inconsistency for %s %s %s %s' %
-                                (eid, rtype, role, targeteid))
+                # this may occurs if the cache has been filed by a hook
+                # after the database update
+                self.debug('cache inconsistency for %s %s %s %s', eid, rtype,
+                           role, targeteid)
+                return
             del rset.rows[idx]
             if isinstance(rset.description, list): # else description not set
                 del rset.description[idx]