1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-25 09:19:31 +00:00

archive checkpoint: Reset timer after the checkpoint has been committed

This commit is contained in:
Jonas Borgström 2014-03-05 20:00:27 +01:00
parent 3193af5482
commit 9dce2362cc

View file

@ -163,10 +163,9 @@ def iter_items(self, filter=None, preload=False):
def add_item(self, item):
self.items_buffer.add(item)
now = time.time()
if now - self.last_checkpoint > self.checkpoint_interval:
self.last_checkpoint = now
if time.time() - self.last_checkpoint > self.checkpoint_interval:
self.write_checkpoint()
self.last_checkpoint = time.time()
def write_checkpoint(self):
self.save(self.checkpoint_name)