Wait for user's content.json on file request
This commit is contained in:
parent
e5e76a4ef5
commit
44dc4c41c9
1 changed files with 14 additions and 8 deletions
|
@ -552,14 +552,20 @@ class Site(object):
|
||||||
if not self.content_manager.contents.get("content.json"):
|
if not self.content_manager.contents.get("content.json"):
|
||||||
return False # Content.json download failed
|
return False # Content.json download failed
|
||||||
|
|
||||||
if not inner_path.endswith("content.json") and not self.content_manager.getFileInfo(inner_path):
|
if not inner_path.endswith("content.json"):
|
||||||
# No info for file, download all content.json first
|
file_info = self.content_manager.getFileInfo(inner_path)
|
||||||
self.log.debug("No info for %s, waiting for all content.json" % inner_path)
|
if not file_info:
|
||||||
success = self.downloadContent("content.json", download_files=False)
|
# No info for file, download all content.json first
|
||||||
if not success:
|
self.log.debug("No info for %s, waiting for all content.json" % inner_path)
|
||||||
return False
|
success = self.downloadContent("content.json", download_files=False)
|
||||||
if not self.content_manager.getFileInfo(inner_path):
|
if not success:
|
||||||
return False # Still no info for file
|
return False
|
||||||
|
file_info = self.content_manager.getFileInfo(inner_path)
|
||||||
|
if not file_info:
|
||||||
|
return False # Still no info for file
|
||||||
|
if "cert_signers" in file_info and not file_info["content_inner_path"] in self.content_manager.contents:
|
||||||
|
self.log.debug("Missing content.json for requested user file: %s" % inner_path)
|
||||||
|
self.downloadContent(file_info["content_inner_path"], download_files=False)
|
||||||
|
|
||||||
task = self.worker_manager.addTask(inner_path, peer, priority=priority)
|
task = self.worker_manager.addTask(inner_path, peer, priority=priority)
|
||||||
if blocking:
|
if blocking:
|
||||||
|
|
Loading…
Reference in a new issue