Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed the checking of available space #337

Merged
merged 2 commits into from
Jan 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions goad/command/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,11 @@ def check_ludus(self):
pass

def check_disk(self, min_disk_gb=120):
disk_usage = psutil.disk_usage('/')
# If the system has multiple mountpoints, '.' will correctly calculate the available space on the current disk
disk_usage = psutil.disk_usage('.')
free_disk_gb = disk_usage.free / (1024 ** 3) # Convert bytes to GB
if free_disk_gb < min_disk_gb:
Log.warning(f'not enought disk space, only {str(free_disk_gb)} Gb available')
Log.warning(f'not enough disk space, only {str(free_disk_gb)} Gb available')
return False
return True

Expand Down