Faster SiteStorage.getSize
This commit is contained in:
parent
38c78dcba1
commit
55d76c8c5c
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue