allow to use values lower than 10 with the flag -memory.allowedPercent (#531)

Co-authored-by: Vyacheslav Mitrofanov <vmitrofanov@mfms.ru>
This commit is contained in:
Vyacheslav Mitrofanov 2020-06-03 23:39:29 +03:00 committed by Aliaksandr Valialkin
parent 21df9025c9
commit 89a922fb19

View file

@ -24,8 +24,8 @@ func initOnce() {
// Do not use logger.Panicf here, since logger may be uninitialized yet.
panic(fmt.Errorf("BUG: memory.Allowed must be called only after flag.Parse call"))
}
if *allowedMemPercent < 10 || *allowedMemPercent > 200 {
logger.Panicf("FATAL: -memory.allowedPercent must be in the range [10...200]; got %f", *allowedMemPercent)
if *allowedMemPercent < 1 || *allowedMemPercent > 200 {
logger.Panicf("FATAL: -memory.allowedPercent must be in the range [1...200]; got %f", *allowedMemPercent)
}
percent := *allowedMemPercent / 100