Merge pull request #84 from truenas/fix-helper

handle case that os.cpu_count is zero
This commit is contained in:
Stavros Kois
2024-07-22 19:47:21 +03:00
committed by GitHub

View File

@@ -7,7 +7,7 @@ def migrate_resources(resources):
if not resources:
return {
"limits": {
"cpus": CPU_COUNT / 2,
"cpus": (CPU_COUNT or 2) / 2,
"memory": f"{TOTAL_MEM / 1024 / 1024}M",
}
}