[downloader] Check for success before adding to resume file

This commit is contained in:
derrod 2020-05-19 14:46:59 +02:00
parent 8cda65fd3e
commit b89afeaefd

View file

@ -500,7 +500,7 @@ class DLManager(Process):
res = self.writer_result_q.get(timeout=1.0) res = self.writer_result_q.get(timeout=1.0)
self.num_tasks_processed_since_last += 1 self.num_tasks_processed_since_last += 1
if res.closed and self.resume_file: if res.closed and self.resume_file and res.success:
# write last completed file to super simple resume file # write last completed file to super simple resume file
with open(self.resume_file, 'ab') as rf: with open(self.resume_file, 'ab') as rf:
rf.write(f'{res.filename}\n'.encode('utf-8')) rf.write(f'{res.filename}\n'.encode('utf-8'))