Stop worker if the file is not required anymore

This commit is contained in:
shortcutme 2018-09-17 15:32:32 +02:00
parent 86d1d4898a
commit 53a40fa914
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -124,6 +124,9 @@ class Worker(object):
if self.peer.hash_failed >= max(len(self.manager.tasks), 3) or self.peer.connection_error > 10:
# Broken peer: More fails than tasks number but atleast 3
break
if task["inner_path"] not in site.bad_files:
# Don't need this file anymore
break
time.sleep(1)
self.peer.onWorkerDone()
self.running = False