Move optional files hashfield adding to workermanager for better performance

This commit is contained in:
shortcutme 2016-10-02 14:18:35 +02:00
parent 906f6c65d9
commit 2ab04deded
2 changed files with 6 additions and 9 deletions

View file

@ -23,7 +23,6 @@ class ContentManager(object):
self.contents = ContentDbDict(site)
self.hashfield = PeerHashfield()
self.has_optional_files = False
self.site.onFileDone.append(lambda inner_path: self.addOptionalFile(inner_path))
def loadContents(self):
if len(self.contents) == 0:
@ -800,12 +799,6 @@ class ContentManager(object):
self.log.error("File not in content.json: %s" % inner_path)
return False
def addOptionalFile(self, inner_path):
info = self.getFileInfo(inner_path)
if info and info["optional"]:
self.log.debug("Downloaded optional file, adding to hashfield: %s" % inner_path)
self.hashfield.appendHash(info["sha512"])
if __name__ == "__main__":
def testSign():