Fixed reduntant bug

pull/3/head
Jef Roosens 2021-01-14 16:39:49 +01:00
parent 5769b00c17
commit 65ffa38edc
1 changed files with 2 additions and 1 deletions

View File

@ -25,7 +25,8 @@ class Spec:
raise NotImplementedError() raise NotImplementedError()
def remove_redundant(self): def remove_redundant(self):
tarballs = self.destination.glob('*.tar.gz') tarballs = sorted(self.destination.glob('*.tar.gz'),
key=os.path.getmtime, reverse=True)
if len(tarballs) >= self.limit: if len(tarballs) >= self.limit:
for path in tarballs[self.limit - 1:]: for path in tarballs[self.limit - 1:]: