only call Atoi on non empty strings

This commit is contained in:
vyzo 2023-03-23 17:28:08 +02:00
parent 7362556c02
commit ee6c0f8570

View File

@ -146,19 +146,21 @@ func init() {
concurrency := os.Getenv("LOTUS_FVM_CONCURRENCY")
if concurrency == "" {
available = DefaultAvailableExecutionLanes
}
available, err = strconv.Atoi(concurrency)
if err != nil {
panic(err)
} else {
available, err = strconv.Atoi(concurrency)
if err != nil {
panic(err)
}
}
reserved := os.Getenv("LOTUS_FVM_CONCURRENCY_RESERVED")
if reserved == "" {
priority = DefaultPriorityExecutionLanes
}
priority, err = strconv.Atoi(reserved)
if err != nil {
panic(err)
} else {
priority, err = strconv.Atoi(reserved)
if err != nil {
panic(err)
}
}
mx := &sync.Mutex{}