Faster SiteStorage.getSize

This commit is contained in:
HelloZeroNet 2016-04-20 23:28:21 +02:00
parent 38c78dcba1
commit 55d76c8c5c

View file

@ -238,9 +238,9 @@ class SiteStorage:
# Get file size # Get file size
def getSize(self, inner_path): def getSize(self, inner_path):
path = self.getPath(inner_path) path = self.getPath(inner_path)
if os.path.isfile(path): try:
return os.path.getsize(path) return os.path.getsize(path)
else: except:
return 0 return 0
# File exist # File exist