api: fix getting cached disk usage with empty dirs
This commit is contained in:
parent
4bc58a3c95
commit
a1b762c65f
|
@ -14,7 +14,7 @@ def _get_disk_usage() -> int:
|
||||||
threshold = timedelta(hours=48)
|
threshold = timedelta(hours=48)
|
||||||
now = datetime.utcnow()
|
now = datetime.utcnow()
|
||||||
if _cache_time and _cache_time > now - threshold:
|
if _cache_time and _cache_time > now - threshold:
|
||||||
assert _cache_result
|
assert _cache_result is not None
|
||||||
return _cache_result
|
return _cache_result
|
||||||
total_size = 0
|
total_size = 0
|
||||||
for dir_path, _, file_names in os.walk(config.config['data_dir']):
|
for dir_path, _, file_names in os.walk(config.config['data_dir']):
|
||||||
|
|
Loading…
Reference in New Issue