summaryrefslogtreecommitdiffstats
path: root/ogcp/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'ogcp/views.py')
-rw-r--r--ogcp/views.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index b41a2bc..c230288 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -408,12 +408,12 @@ def hash_password(pwd):
def get_cache_info(clients_info, storage_data, images_data, client_images):
for client_info in clients_info:
ip = client_info['ip']
- cache_size = int(client_info['cache_size'])
- used_cache = 0
+ cache_size = client_info['cache_size'] * 1024
+ used_cache = client_info['used_cache']
+ free_cache = client_info['free_cache']
for image_info in client_info['images']:
image_name = image_info['name']
checksum = image_info['checksum']
- used_cache += int(image_info['size'])
img_identifier = f'{image_name}.{checksum}'
if ip in client_images:
@@ -432,7 +432,7 @@ def get_cache_info(clients_info, storage_data, images_data, client_images):
}
storage_data[ip] = {'used': used_cache,
- 'total': cache_size}
+ 'free': free_cache}
def authenticate_user(username, pwd):
for user in app.config['USERS']: