summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xhosts/vidhar/borg/copy.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/hosts/vidhar/borg/copy.py b/hosts/vidhar/borg/copy.py
index 46c9bcee..2ee4761d 100755
--- a/hosts/vidhar/borg/copy.py
+++ b/hosts/vidhar/borg/copy.py
@@ -71,23 +71,13 @@ def read_repo(path):
71 71
72class ToSync: 72class ToSync:
73 to_sync = deque() 73 to_sync = deque()
74 seen = set()
75 74
76 def __iter__(self): 75 def __iter__(self):
77 return self 76 return self
78 77
79 def __next__(self): 78 def __next__(self):
80 if self.to_sync: 79 if self.to_sync:
81 next_repo = self.to_sync.popleft() 80 return self.to_sync.popleft()
82 if next_repo['id'] in self.seen:
83 self.to_sync = deque()
84 self.seen = set()
85 next_repo = None
86 else:
87 self.seen.add(next_repo['id'])
88
89 if next_repo:
90 return next_repo
91 81
92 while True: 82 while True:
93 try: 83 try: