Make listmodified query use content.db cache

This commit is contained in:
shortcutme 2016-09-04 17:56:33 +02:00
parent 135a9b8f5c
commit 8f158cbc8f

View file

@ -261,10 +261,10 @@ class Site(object):
continue # Failed query continue # Failed query
queried.append(peer) queried.append(peer)
num_modified = 0 modified_contents = []
my_modified = self.content_manager.listModified(since)
for inner_path, modified in res["modified_files"].iteritems(): # Check if the peer has newer files than we for inner_path, modified in res["modified_files"].iteritems(): # Check if the peer has newer files than we
content = self.content_manager.contents.get(inner_path) newer = int(modified) > my_modified.get(inner_path, 0)
newer = not content or modified > content["modified"]
if newer and inner_path not in self.bad_files and not self.content_manager.isArchived(inner_path, modified): if newer and inner_path not in self.bad_files and not self.content_manager.isArchived(inner_path, modified):
num_modified += 1 num_modified += 1
# We dont have this file or we have older # We dont have this file or we have older