Pruning scheduling fix

Tue, 14 Aug 2018 22:57:48 -0500

author
Tuomo Valkonen <tuomov@iki.fi>
date
Tue, 14 Aug 2018 22:57:48 -0500
changeset 116
4a56dda09745
parent 115
df0de44d2c4b
child 117
b509a4e34d7f

Pruning scheduling fix

borgend/backup.py file | annotate | diff | comparison | revisions
--- a/borgend/backup.py	Fri Feb 16 23:25:30 2018 +0000
+++ b/borgend/backup.py	Tue Aug 14 22:57:48 2018 -0500
@@ -271,6 +271,7 @@
         self.previous_operation_of_type={}
         self.state=State.INACTIVE
         self.timeclass=DreamTime
+        self.start_time=self.timeclass.now()
 
         self.__decode_config(cfg)
 
@@ -517,6 +518,7 @@
         # Wait for main logger thread to terminate, or for us to be terminated
         while not self._terminate_or_pause() and self.thread_res.is_alive():
             self._cond.release()
+            # Maybe wait for borg instead?
             self.thread_res.join(JOIN_TIMEOUT)
             self._cond.acquire()
 
@@ -647,6 +649,11 @@
                                          important=False,
                                          initial_reason=None);
 
+        if prune:
+            self.logger.debug("prune scheduled at %s " % prune.start_time.isoformat())
+        else:
+            self.logger.debug("no prune scheduled")
+
         if not prune:
             return create
         elif not create:
@@ -695,7 +702,7 @@
                 if important:
                     tm=MonotonicTime.now()
                 else:
-                    tm=self.timeclass.after(standard_interval)
+                    tm=self.timeclass.after_other(self.start_time, standard_interval)
                 if initial_reason:
                     return Operation(optype, tm, reason=initial_reason)
                 else:

mercurial