Fix handling of FileNotFoundError during size calculation

remotes/1697617238042506578/master
Inex Code 2022-09-22 18:34:33 +03:00
parent 582e38452d
commit e387e30983
2 changed files with 7 additions and 2 deletions

View File

@ -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"

View File

@ -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