avoid creating a new instance of CleanupDeletedEidsCacheOp if nothing was deleted stable
authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>
Wed, 26 Jan 2011 10:42:40 +0100
branchstable
changeset 6893 2e10337c9c2c
parent 6892 e73245c14516
child 6894 ba3f7e655414
avoid creating a new instance of CleanupDeletedEidsCacheOp if nothing was deleted
server/ssplanner.py
--- a/server/ssplanner.py	Tue Jan 25 15:16:05 2011 +0100
+++ b/server/ssplanner.py	Wed Jan 26 10:42:40 2011 +0100
@@ -645,15 +645,16 @@
     def execute(self):
         """execute this step"""
         results = self.execute_child()
-        todelete = frozenset(typed_eid(eid) for eid, in results)
-        session = self.plan.session
-        # mark eids as being deleted in session info and setup cache update
-        # operation (register pending eids before actual deletion to avoid
-        # multiple call to glob_delete_entities)
-        op = CleanupDeletedEidsCacheOp.get_instance(session)
-        actual = todelete - op._container
-        op._container |= actual
-        session.repo.glob_delete_entities(session, actual)
+        if results:
+            todelete = frozenset(typed_eid(eid) for eid, in results)
+            session = self.plan.session
+            # mark eids as being deleted in session info and setup cache update
+            # operation (register pending eids before actual deletion to avoid
+            # multiple call to glob_delete_entities)
+            op = CleanupDeletedEidsCacheOp.get_instance(session)
+            actual = todelete - op._container
+            op._container |= actual
+            session.repo.glob_delete_entities(session, actual)
         return results
 
 class DeleteRelationsStep(Step):