handle case that os.cpu_count is zero

This commit is contained in:
Stavros kois
2024-07-22 19:39:35 +03:00
parent ccb716308c
commit b7e66a46aa

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",
}
}