# HG changeset patch # User Alexandre Fayolle # Date 1296034960 -3600 # Node ID 2e10337c9c2cb275ad68b28cf28aed62f0273007 # Parent e73245c14516e6c1ace3212f6d718e8c3a0fc5d2 avoid creating a new instance of CleanupDeletedEidsCacheOp if nothing was deleted diff -r e73245c14516 -r 2e10337c9c2c 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):