avoid creating a new instance of CleanupDeletedEidsCacheOp if nothing was deleted
--- 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):