Only try to get more peers for timeout task if site is recently added
This commit is contained in:
parent
a0dfbe31f6
commit
b7bc197012
2 changed files with 4 additions and 1 deletions
|
@ -150,6 +150,9 @@ class Site(object):
|
||||||
return size_limit
|
return size_limit
|
||||||
return 999999
|
return 999999
|
||||||
|
|
||||||
|
def isAddedRecently(self):
|
||||||
|
return time.time() - self.settings.get("added", 0) < 60 * 60 * 24
|
||||||
|
|
||||||
# Download all file from content.json
|
# Download all file from content.json
|
||||||
def downloadContent(self, inner_path, download_files=True, peer=None, check_modifications=False, diffs={}):
|
def downloadContent(self, inner_path, download_files=True, peer=None, check_modifications=False, diffs={}):
|
||||||
s = time.time()
|
s = time.time()
|
||||||
|
|
|
@ -84,7 +84,7 @@ class WorkerManager(object):
|
||||||
len(task["peers"] or []), len(task["failed"]), len(self.asked_peers)
|
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
|
task["site"].announce(mode="more") # Find more peers
|
||||||
announced = True
|
announced = True
|
||||||
if task["optional_hash_id"]:
|
if task["optional_hash_id"]:
|
||||||
|
|
Loading…
Reference in a new issue