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 GitHub
parent a99d606220
commit 72ff05255f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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