List modified files using content.db
This commit is contained in:
parent
f4de16fde6
commit
d6cc40cf3b
2 changed files with 4 additions and 5 deletions
|
@ -247,6 +247,9 @@ class ContentManager(object):
|
||||||
else:
|
else:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
def listModified(self, since):
|
||||||
|
return self.contents.db.listModified(self.site.address, since)
|
||||||
|
|
||||||
|
|
||||||
# Returns if file with the given modification date is archived or not
|
# Returns if file with the given modification date is archived or not
|
||||||
def isArchived(self, inner_path, modified):
|
def isArchived(self, inner_path, modified):
|
||||||
|
|
|
@ -291,11 +291,7 @@ class FileRequest(object):
|
||||||
if not site or not site.settings["serving"]: # Site unknown or not serving
|
if not site or not site.settings["serving"]: # Site unknown or not serving
|
||||||
self.response({"error": "Unknown site"})
|
self.response({"error": "Unknown site"})
|
||||||
return False
|
return False
|
||||||
modified_files = {
|
modified_files = site.content_manager.listModified(params["since"])
|
||||||
inner_path: content["modified"]
|
|
||||||
for inner_path, content in site.content_manager.contents.iteritems()
|
|
||||||
if content["modified"] > params["since"]
|
|
||||||
}
|
|
||||||
|
|
||||||
# Add peer to site if not added before
|
# Add peer to site if not added before
|
||||||
connected_peer = site.addPeer(self.connection.ip, self.connection.port)
|
connected_peer = site.addPeer(self.connection.ip, self.connection.port)
|
||||||
|
|
Loading…
Reference in a new issue