This commit is contained in:
2025-03-09 22:00:23 -04:00
parent 519a30e11e
commit 8f87403d48

View File

@ -785,20 +785,19 @@ class SystemHealthMonitor:
size_str = size_str.strip().upper()
match = re.match(r'^([\d.]+)\s*([KMGT])?B?$', size_str) # Corrected regex
match = re.match(r'^([\d.]+)\s*([KMGT])B?$', size_str)
if match:
value = float(match.group(1))
unit = match.group(2) if match.group(2) else 'B'
unit = match.group(2)
multipliers = {
'B': 1,
'K': 1024,
'M': 1024**2,
'G': 1024**3,
'T': 1024**4
}
return value * multipliers[unit]
return value * multipliers.get(unit, 1) # Default to 1 for bytes
return 0.0