Don't load empty piecefields from sites.json

This commit is contained in:
shortcutme 2017-10-13 01:15:21 +02:00
parent 4a75d9d4f5
commit b322b750c2
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -332,7 +332,8 @@ class SiteStoragePlugin(object):
self.piecefields = collections.defaultdict(BigfilePiecefield)
if "piecefields" in self.site.settings.get("cache", {}):
for sha512, piecefield_packed in self.site.settings["cache"].get("piecefields").iteritems():
self.piecefields[sha512].unpack(piecefield_packed.decode("base64"))
if piecefield_packed:
self.piecefields[sha512].unpack(piecefield_packed.decode("base64"))
self.site.settings["cache"]["piecefields"] = {}
def createSparseFile(self, inner_path, size, sha512=None):