def restore_state(self, state): Partition.restore_state(self, state) try: self.cleanup_pending = state['cleanup_pending'] if self.cleanup_pending and self.state == 'idle': self.state = 'cleanup' except KeyError: self.cleanup_pending = False
def get_state(self): state = {} state.update(Partition.get_state(self)) state['cleanup_pending'] = self.cleanup_pending return state
def __init__(self, spec): Partition.__init__(self, spec) self.cleanup_pending = False self.cleanup_timer = None