summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorrr- <rr-@sakuya.pl>2017-05-01 20:26:53 +0200
committerrr- <rr-@sakuya.pl>2017-05-01 20:26:53 +0200
commita1b762c65fe5bc309bbbec8be2873a660e905a62 (patch)
treefe777d3ed80920b11e0f50d6c1e1f726587cabcc /server
parent4bc58a3c9531c948aa070c2d42ad93b34de5a464 (diff)
api: fix getting cached disk usage with empty dirs
Diffstat (limited to 'server')
-rw-r--r--server/szurubooru/api/info_api.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/server/szurubooru/api/info_api.py b/server/szurubooru/api/info_api.py
index 97bfa39..c21ba9d 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']):