Пример #1
0
 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
Пример #2
0
 def get_state(self):
     state = {}
     state.update(Partition.get_state(self))
     state['cleanup_pending'] = self.cleanup_pending
     return state
Пример #3
0
 def __init__(self, spec):
     Partition.__init__(self, spec)
     self.cleanup_pending = False
     self.cleanup_timer = None