From a1b762c65fe5bc309bbbec8be2873a660e905a62 Mon Sep 17 00:00:00 2001 From: rr- Date: Mon, 1 May 2017 20:26:53 +0200 Subject: [PATCH] api: fix getting cached disk usage with empty dirs --- server/szurubooru/api/info_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/szurubooru/api/info_api.py b/server/szurubooru/api/info_api.py index 97bfa390..c21ba9d1 100644 --- a/server/szurubooru/api/info_api.py +++ b/server/szurubooru/api/info_api.py @@ -14,7 +14,7 @@ def _get_disk_usage() -> int: threshold = timedelta(hours=48) now = datetime.utcnow() if _cache_time and _cache_time > now - threshold: - assert _cache_result + assert _cache_result is not None return _cache_result total_size = 0 for dir_path, _, file_names in os.walk(config.config['data_dir']):