Adds a warning on max-cpu = 1

Former-commit-id: ed02328d7d0e36b7c6b77ea776c0bde7c0eb64f3
This commit is contained in:
Eric Coissac
2024-04-30 13:27:19 +02:00
parent d30d736e48
commit 33d4d63acd

View File

@ -88,7 +88,12 @@ func GenerateOptionParser(optionset ...func(*getoptions.GetOpt)) ArgumentParser
}
// Setup the maximum number of CPU usable by the program
runtime.GOMAXPROCS(_MaxAllowedCPU)
if _MaxAllowedCPU == 1 {
log.Warn("Limitating the Maximum number of CPU to 1 is not recommanded")
runtime.GOMAXPROCS(1)
} else {
runtime.GOMAXPROCS(_MaxAllowedCPU)
}
if options.Called("max-cpu") {
log.Printf("CPU number limited to %d", _MaxAllowedCPU)
}