mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-25 13:31:27 +00:00
Fix handling of FileNotFoundError during size calculation
This commit is contained in:
parent
582e38452d
commit
e387e30983
|
@ -27,4 +27,4 @@ async def get_token_header(
|
|||
|
||||
def get_api_version() -> str:
|
||||
"""Get API version"""
|
||||
return "2.0.7"
|
||||
return "2.0.8"
|
||||
|
|
|
@ -12,5 +12,10 @@ def get_storage_usage(path: str) -> int:
|
|||
for iter_path in pathlib.Path(path).rglob("**/*"):
|
||||
if iter_path.is_dir():
|
||||
continue
|
||||
storage_usage += iter_path.stat().st_size
|
||||
try:
|
||||
storage_usage += iter_path.stat().st_size
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
except Exception as error:
|
||||
print(error)
|
||||
return storage_usage
|
||||
|
|
Loading…
Reference in a new issue