Only try to get more peers for timeout task if site is recently added

This commit is contained in:
Tamas Kocsis 2020-09-08 19:26:18 +02:00
parent a0dfbe31f6
commit b7bc197012
2 changed files with 4 additions and 1 deletions

View File

@ -150,6 +150,9 @@ class Site(object):
return size_limit
return 999999
def isAddedRecently(self):
return time.time() - self.settings.get("added", 0) < 60 * 60 * 24
# Download all file from content.json
def downloadContent(self, inner_path, download_files=True, peer=None, check_modifications=False, diffs={}):
s = time.time()

View File

@ -84,7 +84,7 @@ class WorkerManager(object):
len(task["peers"] or []), len(task["failed"]), len(self.asked_peers)
)
)
if not announced:
if not announced and task["site"].isAddedRecently():
task["site"].announce(mode="more") # Find more peers
announced = True
if task["optional_hash_id"]: