mirror of
https://github.com/truenas/scale-build.git
synced 2025-12-24 04:50:48 +00:00
13 lines
280 B
Python
13 lines
280 B
Python
from functools import cache
|
|
|
|
REQUIRED_RAM_GB = 16 * (1024 ** 3)
|
|
|
|
__all__ = ("has_low_ram",)
|
|
|
|
|
|
@cache
|
|
def has_low_ram():
|
|
with open('/proc/meminfo') as f:
|
|
for line in filter(lambda x: 'MemTotal' in x, f):
|
|
return int(line.split()[1]) * 1024 < REQUIRED_RAM_GB
|