269 self.current_operation=None |
269 self.current_operation=None |
270 self.scheduled_operation=None |
270 self.scheduled_operation=None |
271 self.previous_operation_of_type={} |
271 self.previous_operation_of_type={} |
272 self.state=State.INACTIVE |
272 self.state=State.INACTIVE |
273 self.timeclass=DreamTime |
273 self.timeclass=DreamTime |
|
274 self.start_time=self.timeclass.now() |
274 |
275 |
275 self.__decode_config(cfg) |
276 self.__decode_config(cfg) |
276 |
277 |
277 super().__init__(target = self.__main_thread, name = self.backup_name) |
278 super().__init__(target = self.__main_thread, name = self.backup_name) |
278 self.daemon=True |
279 self.daemon=True |
515 current=self.current_operation |
516 current=self.current_operation |
516 |
517 |
517 # Wait for main logger thread to terminate, or for us to be terminated |
518 # Wait for main logger thread to terminate, or for us to be terminated |
518 while not self._terminate_or_pause() and self.thread_res.is_alive(): |
519 while not self._terminate_or_pause() and self.thread_res.is_alive(): |
519 self._cond.release() |
520 self._cond.release() |
|
521 # Maybe wait for borg instead? |
520 self.thread_res.join(JOIN_TIMEOUT) |
522 self.thread_res.join(JOIN_TIMEOUT) |
521 self._cond.acquire() |
523 self._cond.acquire() |
522 |
524 |
523 # If terminate or pause has been signalled, let outer termination handler |
525 # If terminate or pause has been signalled, let outer termination handler |
524 # take care of things (Within this Backup class, it would be cleanest |
526 # take care of things (Within this Backup class, it would be cleanest |
693 return None |
700 return None |
694 else: |
701 else: |
695 if important: |
702 if important: |
696 tm=MonotonicTime.now() |
703 tm=MonotonicTime.now() |
697 else: |
704 else: |
698 tm=self.timeclass.after(standard_interval) |
705 tm=self.timeclass.after_other(self.start_time, standard_interval) |
699 if initial_reason: |
706 if initial_reason: |
700 return Operation(optype, tm, reason=initial_reason) |
707 return Operation(optype, tm, reason=initial_reason) |
701 else: |
708 else: |
702 return Operation(optype, tm) |
709 return Operation(optype, tm) |
703 else: |
710 else: |