summaryrefslogtreecommitdiffstats
path: root/ogcp
diff options
context:
space:
mode:
Diffstat (limited to 'ogcp')
-rw-r--r--ogcp/views.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index 5418018..edcc2ab 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -956,20 +956,17 @@ def image_fits_in_cache(server, clients_info, image):
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
has_image = False;
for image_info in client_info['images']:
- used_cache += int(image_info['size'])
-
if image_info['checksum'] == image_checksum:
has_image = True
if has_image:
continue
- free_cache = cache_size - used_cache
+ free_cache = client_info['free_cache']
if free_cache < image_size:
missing_cache = image_size - free_cache
err_report += f'{ip} requires {(missing_cache / (1024 ** 3)):.3f} free GiB<br>'