Use renamed optionalRemoved function
This commit is contained in:
parent
508d2472e9
commit
16a9f38844
1 changed files with 2 additions and 2 deletions
|
@ -203,7 +203,7 @@ class ContentDbPlugin(object):
|
||||||
def setContent(self, site, inner_path, content, size=0):
|
def setContent(self, site, inner_path, content, size=0):
|
||||||
super(ContentDbPlugin, self).setContent(site, inner_path, content, size=size)
|
super(ContentDbPlugin, self).setContent(site, inner_path, content, size=size)
|
||||||
old_content = site.content_manager.contents.get(inner_path, {})
|
old_content = site.content_manager.contents.get(inner_path, {})
|
||||||
if (not self.need_filling or self.filled.get(site.address)) and "files_optional" in content or "files_optional" in old_content:
|
if (not self.need_filling or self.filled.get(site.address)) and ("files_optional" in content or "files_optional" in old_content):
|
||||||
self.setContentFilesOptional(site, inner_path, content)
|
self.setContentFilesOptional(site, inner_path, content)
|
||||||
# Check deleted files
|
# Check deleted files
|
||||||
if old_content:
|
if old_content:
|
||||||
|
@ -389,7 +389,7 @@ class ContentDbPlugin(object):
|
||||||
site.log.debug("Deleting %s %.3f MB left" % (row["inner_path"], float(need_delete) / 1024 / 1024))
|
site.log.debug("Deleting %s %.3f MB left" % (row["inner_path"], float(need_delete) / 1024 / 1024))
|
||||||
deleted_file_ids.append(row["file_id"])
|
deleted_file_ids.append(row["file_id"])
|
||||||
try:
|
try:
|
||||||
site.content_manager.optionalRemove(row["inner_path"], row["hash_id"], row["size"])
|
site.content_manager.optionalRemoved(row["inner_path"], row["hash_id"], row["size"])
|
||||||
site.storage.delete(row["inner_path"])
|
site.storage.delete(row["inner_path"])
|
||||||
need_delete -= row["size"]
|
need_delete -= row["size"]
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
|
|
Loading…
Reference in a new issue