From 957110f6549c2917d0f47951923d454891d6fdb3 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 17 Feb 2022 13:54:37 +0100 Subject: vidhar: ... --- hosts/vidhar/borg/copy.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'hosts/vidhar/borg') diff --git a/hosts/vidhar/borg/copy.py b/hosts/vidhar/borg/copy.py index cbd12469..23c45fcf 100755 --- a/hosts/vidhar/borg/copy.py +++ b/hosts/vidhar/borg/copy.py @@ -51,13 +51,13 @@ def read_repo(path): return res class ToSync: - to_sync = None + to_sync = set() def __iter__(self): return self def __next__(self): - if to_sync: + if self.to_sync: return self.to_sync.pop() while True: @@ -68,12 +68,11 @@ class ToSync: print(err, file=stderr) continue - self.to_sync = set() for entry in src: if entry['name'] not in {dst_entry['name'] for dst_entry in dst} and not entry['name'].endswith('.checkpoint'): self.to_sync.add(entry) - if to_sync: + if self.to_sync: return self.to_sync.pop() raise StopIteration -- cgit v1.2.3