Fix GiBs in the "insufficient disk space" message (#187)

pull/189/head
Alexander Borzunov 1 year ago committed by GitHub
parent 391c855208
commit 16b69d6050
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -73,14 +73,14 @@ def free_disk_space_for(
if freed_space >= extra_space_needed:
break
gib = 1024**3
if pending_removal:
gib = 1024**3
logger.info(f"Removing {len(pending_removal)} blocks to free {freed_space / gib:.1f} GiB of disk space")
delete_strategy = cache_info.delete_revisions(*pending_removal)
delete_strategy.execute()
if freed_space < extra_space_needed:
raise RuntimeError(
f"Insufficient disk space to load a block. Please free {extra_space_needed - freed_space:.1f} GiB "
f"Insufficient disk space to load a block. Please free {(extra_space_needed - freed_space) / gib:.1f} GiB "
f"on the volume for {cache_dir} or increase --max_disk_space if you set it manually"
)

Loading…
Cancel
Save